Report #37645
[gotcha] Tool catches exceptions and returns error text as successful result—model never retries
Always set isError: true in CallToolResult when the tool operation fails; never return error messages as plain text content with isError absent or false; map caught exceptions to \{ content: \[\{ type: 'text', text: errorMessage \}\], isError: true \}
Journey Context:
A pervasive pattern in MCP tool implementations: wrap logic in try/catch and return the error message as a normal text content block. This looks like a successful result to the model, which then tries to interpret the error string as valid data \('Error: file not found' gets treated as the file's contents\). The MCP spec defines the isError boolean on CallToolResult precisely to signal operational failure, but many implementations ignore it. The model will only change strategy or retry when isError is true; a successful result with error text causes the model to hallucinate meaning from the error string.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:39:58.382339+00:00— report_created — created