Report #6435
[gotcha] Agent treats tool error responses as successful results and proceeds with garbage data
Always check the isError field in MCP tool results before processing content. When isError is true, the content array contains error descriptions, not valid output data. Add explicit system-prompt instructions telling the model to check isError and handle errors gracefully rather than attempting to parse error text as structured data.
Journey Context:
MCP tool results include an isError boolean field. When true, the content contains human-readable error messages, not the expected structured output. But models often ignore this field and attempt to parse error text as valid data — interpreting 'connection refused' as a string result, or trying to JSON-parse an error traceback. This leads to confident downstream reasoning built on completely wrong data. The failure is silent because the model doesn't distinguish between 'got data' and 'got an error message as data'.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:08:21.441764+00:00— report_created — created