[GH-ISSUE #23778] bug: MCP tools with no arguments fail: empty string not handled in tool call argument parsing #35600

Closed
opened 2026-04-25 09:46:45 -05:00 by GiteaMirror · 2 comments
Owner

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:

Error: Tool call arguments could not be parsed. The model generated malformed or incomplete JSON for `123_getAccessibleAtlassianResources`. Please try again.

The MCP connection itself works fine (HTTP 200 responses from the MCP server). The error is in the middleware argument parsing.

Environment

  • OpenWebUI version: 0.8.6
  • Model: Claude Sonnet 4.5 via AWS Bedrock (aws.eu.anthropic.claude-sonnet-4-5-20250929-v1:0)
  • MCP server: Atlassian MCP (https://mcp.atlassian.com/v1/mcp)
  • Deployment: Kubernetes

Root Cause

In backend/open_webui/utils/middleware.py around line 4136:

tool_args = tool_call.get("function", {}).get("arguments", "{}")

The .get("arguments", "{}") default only applies when the arguments key is absent. When the model returns {"arguments": ""} (empty string) for a zero-argument tool call, the empty string passes through, and both ast.literal_eval("") and json.loads("") raise exceptions.

Server log confirms the arguments are empty:

ERROR | open_webui.utils.middleware:response_handler:4148 - Error parsing tool call arguments:

(nothing after the colon)

Suggested Fix

tool_args = tool_call.get("function", {}).get("arguments", "{}") or "{}"

The or "{}" catches empty/falsy argument strings and treats them as empty JSON objects, which is the correct semantic for zero-argument tool calls.

  • Discussion #14882 and PR #14886 addressed a similar issue but did not cover the empty-string case
  • This affects any MCP tool that takes no required parameters, not just Atlassian
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: ``` Error: Tool call arguments could not be parsed. The model generated malformed or incomplete JSON for `123_getAccessibleAtlassianResources`. Please try again. ``` The MCP connection itself works fine (HTTP 200 responses from the MCP server). The error is in the middleware argument parsing. ## Environment - **OpenWebUI version:** 0.8.6 - **Model:** Claude Sonnet 4.5 via AWS Bedrock (`aws.eu.anthropic.claude-sonnet-4-5-20250929-v1:0`) - **MCP server:** Atlassian MCP (`https://mcp.atlassian.com/v1/mcp`) - **Deployment:** Kubernetes ## Root Cause In `backend/open_webui/utils/middleware.py` around line 4136: ```python tool_args = tool_call.get("function", {}).get("arguments", "{}") ``` The `.get("arguments", "{}")` default only applies when the `arguments` key is **absent**. When the model returns `{"arguments": ""}` (empty string) for a zero-argument tool call, the empty string passes through, and both `ast.literal_eval("")` and `json.loads("")` raise exceptions. Server log confirms the arguments are empty: ``` ERROR | open_webui.utils.middleware:response_handler:4148 - Error parsing tool call arguments: ``` (nothing after the colon) ## Suggested Fix ```python tool_args = tool_call.get("function", {}).get("arguments", "{}") or "{}" ``` 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 - Discussion #14882 and PR #14886 addressed a similar issue but did not cover the empty-string case - This affects any MCP tool that takes no required parameters, not just Atlassian
Author
Owner

@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:

  • bug: Bug report or error you've encountered
  • feat: Feature request or enhancement suggestion
  • docs: Documentation issue or improvement request
  • question: Question about usage or functionality
  • help: Request for help or support

Example: bug: Login fails when using special characters in password

<!-- gh-comment-id:4258971732 --> @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: - **bug**: Bug report or error you've encountered - **feat**: Feature request or enhancement suggestion - **docs**: Documentation issue or improvement request - **question**: Question about usage or functionality - **help**: Request for help or support Example: `bug: Login fails when using special characters in password`
Author
Owner

@tjbck commented on GitHub (Apr 17, 2026):

Please update to the latest.

<!-- gh-comment-id:4264932179 --> @tjbck commented on GitHub (Apr 17, 2026): Please update to the latest.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35600