Report #7245
[gotcha] Agent treats tool error results as successful data and hallucinates follow-up actions
Always check the \`isError\` boolean in tool results. When \`isError\` is true, inject a clear system-level marker that the tool failed and the content is an error message, not data. Prepend error results with a sentinel like '\[TOOL\_ERROR\]' and instruct the agent not to parse the error content as valid output.
Journey Context:
The MCP spec defines \`isError\` as a boolean on tool results, but LLM-based clients do not automatically treat error results differently from successful ones. The error message text gets injected into context just like a successful result, and the LLM may try to parse or act on it. This is especially dangerous when error messages contain partial data, stack traces, or formatted output that the model misinterprets as valid. The model sees structured text and assumes success.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:13:21.997647+00:00— report_created — created