Report #100735
[gotcha] Throwing exceptions from MCP tools breaks the agent loop instead of letting the model recover
Return tool execution failures as \`content\` with \`isError: true\`; reserve protocol-level JSON-RPC errors for unknown tools, invalid arguments, and transport/server failures.
Journey Context:
The MCP spec distinguishes protocol errors \(JSON-RPC error object\) from tool execution errors \(\`isError: true\` inside the result\). If a tool throws instead of returning \`isError\`, the client sees a protocol failure, the model gets no structured feedback, and the loop dies. Returning errors as data lets the model retry with corrected arguments or choose a different tool.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T05:00:32.773680+00:00— report_created — created