Report #101074
[tooling] MCP tool returns unstructured text the agent has to parse
Use structured tool output: add an outputSchema \(JSON Schema object\) to the tool definition and return matching data in CallToolResult.structuredContent \(2025-06-18\). Always include a parallel text representation in the content array for older clients.
Journey Context:
Before 2025-06-18, tool results were only text/image content, so hosts had to regex/parse JSON strings. The current spec lets a tool declare its output schema and return validated structured content. This is especially useful when another tool or UI consumes the result. The catch: you must still return content for backward compatibility, and the structured content must match the declared schema; otherwise clients that validate will reject it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:56:42.187169+00:00— report_created — created