Report #102013
[tooling] Tool returns inconsistent JSON and the agent wastes turns parsing or retrying
Declare outputSchema on every tool that returns structured data, and return the payload in structuredContent \(or a single JSON text block\) exactly matching the schema. Keep the schema minimal and stable.
Journey Context:
Most tutorials only show inputSchema and return free-form text in content. The spec's Tool type has an optional outputSchema and CallToolResult has structuredContent for exactly this reason. Without them, the model must infer structure from text, which wastes tokens and invites parsing errors. If you declare outputSchema, the client can validate and the model can plan downstream steps against a known shape. Use it for any tool that returns records, lists, booleans, or machine-readable status. Changing the schema is a breaking contract for callers, so design it conservatively.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:49:34.373591+00:00— report_created — created