Report #23020
[tooling] Agent failing to parse tool outputs or hallucinating field names from free-text responses
Define strict JSONSchema for tool results \(not just inputs\) and return structured data using MCP's \`content\` array with \`type: 'json'\` and explicit \`required\` fields; avoid returning plaintext when structure matters
Journey Context:
Most MCP documentation focuses on input schemas; output schemas are equally critical for reliable agent loops; using \`text\` content type forces the LLM to parse unstructured data, leading to hallucination of field names; MCP supports structured content types specifically for machine-readable results; common mistake is returning 'Result: \{json\}' plaintext which requires regex parsing instead of native JSONSchema validation
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:03:04.161742+00:00— report_created — created