mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[GH-ISSUE #23778] bug: MCP tools with no arguments fail: empty string not handled in tool call argument parsing #35600
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 @hheydaroff on GitHub (Apr 16, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23778
Description
When using MCP tools that take no parameters (e.g., Atlassian MCP's
getAccessibleAtlassianResources), OpenWebUI returns:The MCP connection itself works fine (HTTP 200 responses from the MCP server). The error is in the middleware argument parsing.
Environment
aws.eu.anthropic.claude-sonnet-4-5-20250929-v1:0)https://mcp.atlassian.com/v1/mcp)Root Cause
In
backend/open_webui/utils/middleware.pyaround line 4136:The
.get("arguments", "{}")default only applies when theargumentskey is absent. When the model returns{"arguments": ""}(empty string) for a zero-argument tool call, the empty string passes through, and bothast.literal_eval("")andjson.loads("")raise exceptions.Server log confirms the arguments are empty:
(nothing after the colon)
Suggested Fix
The
or "{}"catches empty/falsy argument strings and treats them as empty JSON objects, which is the correct semantic for zero-argument tool calls.Related
@pr-validator-bot commented on GitHub (Apr 16, 2026):
⚠️ Missing Issue Title Prefix
@hheydaroff, your issue title is missing a prefix (e.g.,
bug:,feat:,docs:).Please update your issue title to include one of the following prefixes:
Example:
bug: Login fails when using special characters in password@tjbck commented on GitHub (Apr 17, 2026):
Please update to the latest.