mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
issue: MCP tool call parsed, but sometimes not executed #6122
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tan-yong-sheng on GitHub (Aug 17, 2025).
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.6.22
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Wish to re-open this bug report: https://github.com/open-webui/open-webui/discussions/16278
Because I think I found the reason of the bug, see below:
(1) https://github.com/open-webui/open-webui/discussions/16278#discussioncomment-14132000
(2) https://github.com/open-webui/open-webui/discussions/16278#discussioncomment-14132465
Actual Behavior
just for your note for function calling API implementatoin which causes MCP tool call parased but sometimes not executed.
This error does not occur every time. Occasionally, the content field is missing in a tool message when using the OpenAI-compatible function calling API (I’m running this through LiteLLM as the wrapper). When that happens, the API returns the following error:
(1) mistral API (via LiteLLM)
(2) gemini-2.5-flash
Another scenario where the tool is not executed properly (very similar to the previous case) happens when I use Gemini 2.5 Flash.
In this example, the function calling API returns
nullfor thecontentfield, while thefinish_reasonis"stop".(Note: Usually, when
finish_reason = "tool", it means the API has returned parameters for function execution, but whenfinish_reason = "stop", it means the conversation is finished without tool execution.)Steps to Reproduce
Native function calling enabled for model, and others are as mentioned above
Logs & Screenshots
As attached
Additional Information
The reason is probably because of:
For example, missing or null 'content' parameter on the response output:
❌ Example (invalid, causes your error):
(i) in mistral (wrapped via LiteLLM)
{
"role": "tool",
"tool_call_id": "4CqS6tOj0"
}
OR
(ii) in gemini-2.5-flash (wrapped via LiteLLM)
{
"role": "tool",
"tool_call_id": "4CqS6tOj0",
"content": ""
}
✅ Example (valid):
{
"role": "tool",
"tool_call_id": "4CqS6tOj0",
"content": "Tool execution result: { ... }"
}
From what I can see, even though the rest of the API endpoint calls are executed correctly, the missing
contentfield seems to stop the MCP tool from finishing its execution.Screenshots:

Not sure whether this originates from LiteLLM or OpenWebUI, but in OpenWebUI we could add logic so that if the API response has a finish_reason of "stop" while the content field is either null or missing, the system should automatically retry/resend the request because that's a malformed output for function calling.
@tan-yong-sheng commented on GitHub (Aug 17, 2025):
Just to add on, this happen when I am trying with tool server, but I suspect it would be the same case for built in tool as well
@tjbck commented on GitHub (Aug 18, 2025):
Unable to reproduce, could you confirm the same issue occurs with openai models?