Report #42243
[gotcha] Tool errors returned as successful results because isError is not set
Always explicitly set isError: true in CallToolResult when the tool operation fails. Never return error messages as plain text content with isError omitted or false. In the TypeScript SDK, either throw an error \(which the SDK handles\) or return \{ content: \[\{ type: 'text', text: errorMessage \}\], isError: true \}.
Journey Context:
When a tool catches an exception and returns the error message as a text content block without setting isError: true, the LLM interprets the error message as a successful result. It then tries to reason about or parse the error text as valid output, leading to hallucinated interpretations of error messages. This is especially insidious because the tool 'worked' from the protocol perspective — no exception was thrown, a result was returned — but the semantic signal is wrong. The MCP spec defines isError as an optional boolean in CallToolResult, defaulting to false when omitted, which means any tool that doesn't explicitly set it on failure is silently misreporting its status.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:22:32.195516+00:00— report_created — created