Report #7003
[gotcha] MCP tool execution errors returned as successful results with error text, causing the model to misinterpret failure as data
Always use the MCP \`isError: true\` flag in \`CallToolResult\` when a tool execution fails. Never return error messages as normal string results. On the client side, check the \`isError\` field and handle it distinctly from successful results.
Journey Context:
It's tempting to catch exceptions in tool handlers and return the error message as a normal text result so the model can 'see what went wrong.' But the model then treats the error text as valid tool output and tries to reason about it as data — parsing error messages, extracting 'values,' or making decisions based on what is actually a failure signal. The MCP spec provides \`isError\` in \`CallToolResult\` precisely to distinguish these cases. When \`isError\` is true, the model knows the tool failed and can retry or pivot instead of hallucinating interpretations of error text. Without this flag, a 'file not found' error string gets treated as the file's contents.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:37:37.521676+00:00— report_created — created