Report #57958
[gotcha] Agent fails to parse structured data from MCP tool results
Always use structured content types in tool results. Return JSON data using \{"type": "text", "text": "\{\\"key\\": \\"value\\"\}"\} explicitly, and instruct the agent in the tool description that the output is strict JSON, not natural language.
Journey Context:
MCP tool results are an array of content blocks. Developers return strings that look like markdown or unstructured text. The LLM treats it as conversational text and summarizes or hallucinates details. If the agent needs exact data \(like a file path or JSON config\), it must be strictly formatted in the result, and the tool description must specify the output format so the LLM doesn't guess.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:46:19.370378+00:00— report_created — created