[GH-ISSUE #20415] issue:[Bug] Native Function Calling fails with multiple tools having long descriptions (Gemini 3 Flash Preview via OpenRouter) #89919

Closed
opened 2026-05-15 14:56:21 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @FujinoXiao on GitHub (Jan 6, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20415

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Git Clone

Open WebUI Version

v0.6.43

Ollama Version (if applicable)

No response

Operating System

ubuntu22.04

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When using google/gemini-3-flash-preview model via OpenRouter with Native Function Calling enabled, the model should be able to handle multiple tools (2 or more) with longer descriptions and return responses normally.

Actual Behavior

When adding 2 or more tools with longer descriptions and enabling Native Function Calling, the model fails to return any response. The error message shows "Provider returned error" with no additional details.
Note: This issue does NOT occur when:

Using only 1 tool, OR
Using 2+ tools with shorter descriptions, OR
Using non-native function calling (disabling Native Function Calling works fine)

This suggests the issue may be related to how Open WebUI handles the tool schema conversion for Native Function Calling when the total schema size is large.

Steps to Reproduce

Steps to Reproduce:

Set up OpenRouter API connection in Open WebUI
Select google/gemini-3-flash-preview model
Enable "Native Function Calling" in model settings
Create two test tools with long descriptions (see example below):

Tool 1 (test_tool_1.py)
`
class Tools:
def init(self):
pass

def test(self) -> str:
    """
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
            this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool        this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool
    this is a test tool

    """
    return "test " * 100

# ... 其他方法 ...

`

Tool 2 (test_tool_2.py): (identical to Tool 1)

Add both tools to the conversation
Send any simple message (e.g., "hello")
Observe: No response is returned, error shows "Provider returned error"

Works fine when:

Only 1 tool is added
Native Function Calling is disabled
Tools have shorter descriptions

Logs & Screenshots

Image

Additional Information

No response

Originally created by @FujinoXiao on GitHub (Jan 6, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20415 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version v0.6.43 ### Ollama Version (if applicable) _No response_ ### Operating System ubuntu22.04 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When using google/gemini-3-flash-preview model via OpenRouter with Native Function Calling enabled, the model should be able to handle multiple tools (2 or more) with longer descriptions and return responses normally. ### Actual Behavior When adding 2 or more tools with longer descriptions and enabling Native Function Calling, the model fails to return any response. The error message shows "Provider returned error" with no additional details. Note: This issue does NOT occur when: Using only 1 tool, OR Using 2+ tools with shorter descriptions, OR Using non-native function calling (disabling Native Function Calling works fine) This suggests the issue may be related to how Open WebUI handles the tool schema conversion for Native Function Calling when the total schema size is large. ### Steps to Reproduce Steps to Reproduce: Set up OpenRouter API connection in Open WebUI Select google/gemini-3-flash-preview model Enable "Native Function Calling" in model settings Create two test tools with long descriptions (see example below): Tool 1 (test_tool_1.py) ` class Tools: def __init__(self): pass def test(self) -> str: """ this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool this is a test tool """ return "test " * 100 # ... 其他方法 ... ` Tool 2 (test_tool_2.py): (identical to Tool 1) Add both tools to the conversation Send any simple message (e.g., "hello") Observe: No response is returned, error shows "Provider returned error" Works fine when: Only 1 tool is added Native Function Calling is disabled Tools have shorter descriptions ### Logs & Screenshots <img width="2163" height="1167" alt="Image" src="https://github.com/user-attachments/assets/77df6337-c854-4d18-bf2d-3347a69c5e8c" /> ### Additional Information _No response_
GiteaMirror added the bug label 2026-05-15 14:56:21 -05:00
Author
Owner

@pr-validator-bot commented on GitHub (Jan 6, 2026):

⚠️ Invalid Issue Title

Hey @qq3829596922, please provide a descriptive title for your issue. Titles that are empty, very short (under 10 characters), or generic (like "issue:") make it difficult for volunteer contributors to understand and triage issues.

Please update the title to reflect the content of your issue.

<!-- gh-comment-id:3713710562 --> @pr-validator-bot commented on GitHub (Jan 6, 2026): # ⚠️ Invalid Issue Title Hey @qq3829596922, please provide a descriptive title for your issue. Titles that are empty, very short (under 10 characters), or generic (like "issue:") make it difficult for volunteer contributors to understand and triage issues. Please update the title to reflect the content of your issue.
Author
Owner

@FujinoXiao commented on GitHub (Jan 7, 2026):

updated

<!-- gh-comment-id:3718081591 --> @FujinoXiao commented on GitHub (Jan 7, 2026): updated
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#89919