Report #14663
[tooling] Agent fails to parse natural language tool output or wastes tokens extracting structured data
Define outputSchema in the tool definition \(MCP 2024-11-05\+\) to force the server to return structured JSON matching the schema, eliminating parsing ambiguity
Journey Context:
Historically, tool results were unstructured text, forcing agents to use prompt engineering like 'return JSON' or regex parsing, which is brittle. The MCP 2024-11-05 specification added outputSchema alongside inputSchema. When you declare this, you're contractually obligating the server to return results that validate against that schema. This allows the client \(agent\) to use strongly-typed JSON parsing instead of NLP extraction. Crucially, this works best when the MCP client enforces validation; if you're writing the server, implement strict schema validation on return values. This saves significant tokens previously spent on 'thinking through' parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T22:11:33.948180+00:00— report_created — created