[GH-ISSUE #24038] issue: MCP tool results with resource content type are silently dropped #58828

Open
opened 2026-05-06 00:15:17 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @jojays on GitHub (Apr 23, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24038

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

Docker

Open WebUI Version

0.9.1

Ollama Version (if applicable)

No response

Operating System

Ubuntu 22.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 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)

Originally created by @jojays on GitHub (Apr 23, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/24038 ### 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 Docker ### Open WebUI Version 0.9.1 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 22.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 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)
GiteaMirror added the bug label 2026-05-06 00:15:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#58828