Report #12861
[gotcha] Agent hallucinates success when MCP tool returns an error
Always check the isError boolean in the MCP CallToolResult object. If true, feed the error content back to the LLM as a failure state, do not treat it as valid data.
Journey Context:
MCP tool results return a 200 OK JSON-RPC response even when the tool execution fails internally \(e.g., API 404, permission denied\). The failure is indicated by isError: true in the result payload. Agents that only check for JSON-RPC level errors \(or no errors at all\) will pass the error message text directly into the LLM's context as if it were successful output, causing the LLM to hallucinate a response based on the error text.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T17:13:00.717572+00:00— report_created — created