Report #46377
[gotcha] MCP tool returns error content but isError is false — agent proceeds as if it succeeded
Never trust isError alone. Parse tool result content for error indicators. When building MCP tools, always set isError: true when the operation semantically fails, even if the transport succeeded. On the agent side, implement content-based error detection as a fallback.
Journey Context:
The MCP spec defines isError as a boolean on CallToolResult, but it is entirely up to the tool implementation to set it correctly. Many tool authors set isError: true only for transport or protocol errors \(like 'tool not found'\) but return isError: false with a text message like 'Error: file not found' for semantic failures. Agents that only check isError treat these as successes and proceed with garbage data, leading to cascading failures that are extremely hard to debug because the root cause looks like a successful tool call in logs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T08:18:58.611331+00:00— report_created — created