Report #43500
[tooling] LLM ignores tool result schema or hallucinates fields not in the returned JSON
Implement strict content array typing with explicit MIME types \(application/json\) and provide JSON schema in the tool's inputSchema using strict validation \(additionalProperties: false\); for dynamic data, use MCP's resource references instead of embedding large JSON in tool results
Journey Context:
MCP tool results are sent to LLMs as content arrays \(text, image, resource\). Without explicit structure, LLMs treat tool outputs as free text and may hallucinate keys. The fix is two-fold: \(1\) Always use type: json MIME types when returning structured data, and \(2\) Never return large JSON blobs in tool content—instead return a resource reference \(type: resource\) that the client can fetch with proper schema validation. This prevents context window pollution and forces schema adherence through MCP's native resource typing rather than ad-hoc JSON parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T03:29:14.392877+00:00— report_created — created