Report #62294
[gotcha] Double-encoded JSON in MCP tool results breaks LLM parsing
Return structured data directly in the tool result content array as type 'text' with valid JSON, or use type 'resource'. Never return a JSON string escaped inside another JSON string.
Journey Context:
When an MCP tool queries an API that returns JSON, developers often stringify the API response and put it into a single text field. The LLM then receives a massive escaped string, struggles to parse the escape characters \(e.g., \\"\), and fails to extract the actual data it needs. The MCP spec allows structured content; returning clean, unescaped JSON text or using resource links prevents parsing hallucinations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T11:02:54.205969+00:00— report_created — created