Skip to content

Calls to external tools using use_mcp_tool are truncated #6108

@m-ibm

Description

@m-ibm

App Version

v3.23.16

API Provider

Not Applicable / Other

Model Used

llama-4-maverick-17b-128e-instruct-fp8

Roo Code Task Links (Optional)

No response

🔁 Steps to Reproduce

Setup: Ubuntu 20.04 on WSL in Windows 11; latest VSCode with RooCode v3.23.16

My MCP server has a tool called render_graph which receives a single JSON parameter representing a NetworkX graph and returns a link to a generated PNG file.

The minimum task that reproduces the error is:

"
[JSON of a NetworkX graph]

Render the above JSON, verbatim, as a PNG
"

The JSON is quite small -- about 10 nodes and 10 edges with some 5 attributes per node. It has ~450 words, so even exaggerating no more than 1k tokens.

Half that graph is the maximum that gets passed correctly to the tool, after that neither JSON nor tool call are properly closed, as if running out of tokens.

I can not see any setting limiting tool input anywhere -- is there such thing?

💥 Outcome Summary

Expected outcome is a link to a PNG image.
What I get is errors about the JSON or the call and unsuccessful attempts to recover.
Asking the model to show me what was passed to the tool shows an incomplete JSON.
I see the same in the logs to WatsonX where the model I use is deployed.

Here is a simplified excerpt from the logs:
`
watsonx-proxy | {
watsonx-proxy | "role": "assistant",
watsonx-proxy | "content": [
watsonx-proxy | {
watsonx-proxy | "type": "text",
watsonx-proxy | "text": "<use_mcp_tool>\n<server_name>FOO</server_name>\n<tool_name>render_graph</tool_name>\n\n{\n "graph": {\n "directed": true,\n "multigraph": false,\n "graph": {},\n "nodes": [\n {\n "entity_name": ...

[
TRUNCATED AFTER ~4000 characters,
or about 400 words,
no closing parenthesis for JSON,
no closing use_mcp_tool tag
]

watsonx-proxy | }
watsonx-proxy | ]
watsonx-proxy | },
watsonx-proxy | {
watsonx-proxy | "role": "user",
watsonx-proxy | "content": [
watsonx-proxy | {
watsonx-proxy | "type": "text",
watsonx-proxy | "text": "[use_mcp_tool for 'FOO'] Result:"
watsonx-proxy | },

watsonx-proxy | {
watsonx-proxy | "type": "text",
watsonx-proxy | "text": "The tool execution failed with the following error:\n\nInvalid JSON argument used with FOO for render_graph. Please retry with a properly formatted JSON argument.\n"
watsonx-proxy | },
watsonx-proxy | {
watsonx-proxy | "type": "text",
watsonx-proxy | "text": "<environment_details>\n# VSCode Visible Files\n\n\n# VSCode Open Tabs\ncompose.yaml,.env,requirements.txt,.roo/rules/rules.md,pyproject.toml\n\n# Current Time\nCurrent time in ISO 8601 UTC format: 2025-07-23T10:21:18.604Z\nUser time zone: Asia/Jerusalem, UTC+3:00\n\n# Current Cost\n$0.00\n\n# Current Mode\nask\n\u2753 Ask\nmeta-llama/llama-4-maverick-17b-128e-instruct-fp8\nYou have not created a todo list yet. Create one with update_todo_list if your task is complicated or involves multiple steps.\n</environment_details>"
watsonx-proxy | }
watsonx-proxy | ]
watsonx-proxy | }
watsonx-proxy | ]
watsonx-proxy | }
`

📄 Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Needs InfoMissing details or unclear. Waiting on author to provide more context.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Issue [Needs Info]

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions