[GH-ISSUE #15911] issue: Tools : JSON malformed #17713

Closed
opened 2026-04-19 23:33:18 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @chdid on GitHub (Jul 21, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/15911

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

0.6.18

Ollama Version (if applicable)

No response

Operating System

docker

Browser (if applicable)

Firefox Chrome

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

Obtain graphic with tool.

Have JSON like
{
"data": [
{"category": "Visiting Website", "value": 50000},
{"category": "Entering Product Page", "value": 35000},
{"category": "Adding to Cart", "value": 25000},
{"category": "Checking Out", "value": 15000},
{"category": "Purchasing", "value": 8000}
]
}

Actual Behavior

JSON is
{'data': "[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]", 'title': 'Funnel Example', 'width': '600', 'height': '400'}}

Steps to Reproduce

I installed the sse version.

  • In Swagger, I can use the available functions. - I added the server in the openwebui administration with the server http://xxxxxx:8010/chart
  • Launched a template based on llama3.3 with activation of the created tool

Logs & Screenshots

2025-07-21 06:58:19.812 | DEBUG | open_webui.utils.middleware:chat_completion_tools_handler:176 - content='{\n "tool_calls": [\n {\n "name": "tool_generate_funnel_chart_post",\n "parameters": {\n "data": "[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]",\n "title": "Funnel Example",\n "width": "600",\n "height": "400"\n }\n }\n ]\n}' - {}

2025-07-21 06:58:19.812 | DEBUG | open_webui.utils.middleware:tool_call_handler:191 - tool_call={'name': 'tool_generate_funnel_chart_post', 'parameters': {'data': "[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]", 'title': 'Funnel Example', 'width': '600', 'height': '400'}} - {}

2025-07-21 06:58:19.827 | ERROR | open_webui.utils.tools:execute_tool_server:644 - API Request Error: HTTP error 422: {"detail":[{"type":"list_type","loc":["body","data"],"msg":"Input should be a valid list","input":"[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]"}]} - {}

[...]

File "/app/backend/open_webui/main.py", line 1404, in chat_completion

form_data, metadata, events = await process_chat_payload(

│          │                        └ <function process_chat_payload at 0x7f9673d6be20>

│          └ {'user_id': 'bd3fe091-c4f0-4c36-80aa-171196085ab2', 'chat_id': '9b0a5bd1-75f0-4515-96ed-31efa22c9aa5', 'message_id': '53bc942...

└ {'stream': True, 'model': 'llama3', 'messages': [{'role': 'user', 'content': 'Generate funnel example in english'}], 'metadat...

File "/app/backend/open_webui/utils/middleware.py", line 942, in process_chat_payload

form_data, flags = await chat_completion_tools_handler(

│                        └ <function chat_completion_tools_handler at 0x7f9673d6b9c0>

└ {'stream': True, 'model': 'llama3', 'messages': [{'role': 'user', 'content': 'Generate funnel example in english'}], 'metadat...

File "/app/backend/open_webui/utils/middleware.py", line 285, in chat_completion_tools_handler

await tool_call_handler(tool_call)

      │                 └ {'name': 'tool_generate_funnel_chart_post', 'parameters': {'data': "[{ category: 'Visiting Website', value: 50000 }, { catego...

      └ <function chat_completion_tools_handler.<locals>.tool_call_handler at 0x7f96719d98a0>

File "/app/backend/open_webui/utils/middleware.py", line 227, in tool_call_handler

tool_result = await tool_function(**tool_function_params)

                    │               └ {'data': "[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: '...

                    └ functools.partial(<function get_tools.<locals>.make_tool_function.<locals>.tool_function at 0x7f96719f87c0>)

File "/app/backend/open_webui/utils/tools.py", line 104, in tool_function

return await execute_tool_server(

             └ <function execute_tool_server at 0x7f96772d5120>

File "/app/backend/open_webui/utils/tools.py", line 629, in execute_tool_server

raise Exception(f"HTTP error {response.status}: {text}")

Exception: HTTP error 422: {"detail":[{"type":"list_type","loc":["body","data"],"msg":"Input should be a valid list","input":"[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]"}]}

Additional Information

No response

Originally created by @chdid on GitHub (Jul 21, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/15911 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.6.18 ### Ollama Version (if applicable) _No response_ ### Operating System docker ### Browser (if applicable) Firefox Chrome ### 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 Obtain graphic with tool. Have JSON like { "data": [ {"category": "Visiting Website", "value": 50000}, {"category": "Entering Product Page", "value": 35000}, {"category": "Adding to Cart", "value": 25000}, {"category": "Checking Out", "value": 15000}, {"category": "Purchasing", "value": 8000} ] } ### Actual Behavior JSON is {'data': "[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]", 'title': 'Funnel Example', 'width': '600', 'height': '400'}} ### Steps to Reproduce - Installed the server in Docker: https://hub.docker.com/r/acuvity/mcp-server-chart - Installed the OpenWebUI proxy - MCP in Docker: https://github.com/open-webui/mcpo - Configured the MCP server on MCPO: { "mcpServers": { "chart": { "type": "sse", "url": "http://xxxxxxxx:8006/sse" } } } I installed the sse version. - In Swagger, I can use the available functions. - I added the server in the openwebui administration with the server http://xxxxxx:8010/chart - Launched a template based on llama3.3 with activation of the created tool ### Logs & Screenshots 2025-07-21 06:58:19.812 | DEBUG | open_webui.utils.middleware:chat_completion_tools_handler:176 - content='{\n "tool_calls": [\n {\n "name": "tool_generate_funnel_chart_post",\n "parameters": {\n "data": "[{ category: \'Visiting Website\', value: 50000 }, { category: \'Entering Product Page\', value: 35000 }, { category: \'Adding to Cart\', value: 25000 }, { category: \'Checking Out\', value: 15000 }, { category: \'Purchasing\', value: 8000 }]",\n "title": "Funnel Example",\n "width": "600",\n "height": "400"\n }\n }\n ]\n}' - {} 2025-07-21 06:58:19.812 | DEBUG | open_webui.utils.middleware:tool_call_handler:191 - tool_call={'name': 'tool_generate_funnel_chart_post', 'parameters': {'data': "[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]", 'title': 'Funnel Example', 'width': '600', 'height': '400'}} - {} 2025-07-21 06:58:19.827 | ERROR | open_webui.utils.tools:execute_tool_server:644 - API Request Error: HTTP error 422: {"detail":[{"type":"list_type","loc":["body","data"],"msg":"Input should be a valid list","input":"[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]"}]} - {} [...] File "/app/backend/open_webui/main.py", line 1404, in chat_completion form_data, metadata, events = await process_chat_payload( │ │ └ <function process_chat_payload at 0x7f9673d6be20> │ └ {'user_id': 'bd3fe091-c4f0-4c36-80aa-171196085ab2', 'chat_id': '9b0a5bd1-75f0-4515-96ed-31efa22c9aa5', 'message_id': '53bc942... └ {'stream': True, 'model': 'llama3', 'messages': [{'role': 'user', 'content': 'Generate funnel example in english'}], 'metadat... File "/app/backend/open_webui/utils/middleware.py", line 942, in process_chat_payload form_data, flags = await chat_completion_tools_handler( │ └ <function chat_completion_tools_handler at 0x7f9673d6b9c0> └ {'stream': True, 'model': 'llama3', 'messages': [{'role': 'user', 'content': 'Generate funnel example in english'}], 'metadat... File "/app/backend/open_webui/utils/middleware.py", line 285, in chat_completion_tools_handler await tool_call_handler(tool_call) │ └ {'name': 'tool_generate_funnel_chart_post', 'parameters': {'data': "[{ category: 'Visiting Website', value: 50000 }, { catego... └ <function chat_completion_tools_handler.<locals>.tool_call_handler at 0x7f96719d98a0> File "/app/backend/open_webui/utils/middleware.py", line 227, in tool_call_handler tool_result = await tool_function(**tool_function_params) │ └ {'data': "[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: '... └ functools.partial(<function get_tools.<locals>.make_tool_function.<locals>.tool_function at 0x7f96719f87c0>) File "/app/backend/open_webui/utils/tools.py", line 104, in tool_function return await execute_tool_server( └ <function execute_tool_server at 0x7f96772d5120> > File "/app/backend/open_webui/utils/tools.py", line 629, in execute_tool_server raise Exception(f"HTTP error {response.status}: {text}") Exception: HTTP error 422: {"detail":[{"type":"list_type","loc":["body","data"],"msg":"Input should be a valid list","input":"[{ category: 'Visiting Website', value: 50000 }, { category: 'Entering Product Page', value: 35000 }, { category: 'Adding to Cart', value: 25000 }, { category: 'Checking Out', value: 15000 }, { category: 'Purchasing', value: 8000 }]"}]} ### Additional Information _No response_
GiteaMirror added the bug label 2026-04-19 23:33:18 -05:00
Author
Owner

@rgaricano commented on GitHub (Jul 23, 2025):

There are something odd in this mcp-server, the request seem that doesn't complain mpc protocol specification,
Make sure you have it updated: https://github.com/antvis/mcp-server-chart
&| report the issue in his repo.

<!-- gh-comment-id:3106732373 --> @rgaricano commented on GitHub (Jul 23, 2025): There are something odd in this mcp-server, the request seem that doesn't complain [mpc protocol specification](https://modelcontextprotocol.info/specification/2024-11-05/), Make sure you have it updated: https://github.com/antvis/mcp-server-chart &| report the issue in his repo.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17713