mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #24038] issue: MCP tool results with resource content type are silently dropped #35690
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 @jojays on GitHub (Apr 23, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24038
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.9.1
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When an MCP server returns a tool result with "type": "resource", OpenWebUI extracts the resource.text field and passes the data to the LLM. The model receives the actual result (e.g., 16 work package statuses) and responds with the correct information.
Actual Behavior
The resource content type is silently dropped. The LLM receives {"results": []} and reports that the data is empty, even though the MCP server returned valid data. Calling the MCP endpoint directly from inside the container confirms the server returns the correct response with 200 OK.
Steps to Reproduce
Start OpenWebUI (v0.9.1, ghcr.io/open-webui/open-webui:main)
Go to Settings > Admin
Configure an MCP server that returns resource content type:
Type: MCP
URL: Openproject MCP url
Auth: Bearer token
Verify tools are discovered (e.g., list_statuses, search_work_packages, etc.)
Open a chat and ask the model to call a tool, e.g. "Can you give me the work package statuses?"
Observe the model response: it reports the results are empty
Logs & Screenshots
MCP connection logs (successful handshake and tool calls):
2026-04-23 13:54:24.994 | INFO | httpx._client:_send_single_request:1740 - HTTP Request: POST https://url/mcp "HTTP/1.1 200 OK"
2026-04-23 13:54:24.995 | INFO | mcp.client.streamable_http:_maybe_extract_protocol_version_from_message:193 - Negotiated protocol version: 2025-11-25
2026-04-23 13:54:25.407 | INFO | httpx._client:_send_single_request:1740 - HTTP Request: POST https://url/mcp "HTTP/1.1 200 OK"
2026-04-23 13:54:25.847 | INFO | httpx._client:_send_single_request:1740 - HTTP Request: POST https://url/mcp "HTTP/1.1 200 OK"
In OpenWebUI the tool calls are however then returning empty results
Additional Information
Root Cause
In open_webui/utils/middleware.py, process_tool_result() (~line 1135), the MCP handler only processes text, image, and audio content types. The resource type is silently skipped, leaving tool_response as []:
if tool_type == 'mcp':
tool_response = []
for item in tool_result:
if item.get('type') == 'text':
# handled
elif item.get('type') in ['image', 'audio']:
# handled
# MISSING: resource type
Suggested Fix
Add handler for resource type in the same block:
elif item.get('type') == 'resource':
resource = item.get('resource', {})
text = resource.get('text', '')
if isinstance(text, str):
try:
text = json.loads(text)
except json.JSONDecodeError:
pass
tool_response.append(text)