Report #12120
[gotcha] Critical error messages lost due to MCP tool result truncation or isError misconfiguration
Always set isError: true in the CallToolResult when a tool execution fails, and keep error payloads concise. Do not rely on the LLM reading a massive stdout dump to infer an error.
Journey Context:
When a tool fails \(e.g., a shell command returns a non-zero exit code\), developers often return the massive stderr output as a standard text result. If the client truncates long tool results to save context, the actual error message at the bottom of the stack trace gets cut off, leaving the LLM with a partial success message. Using the isError flag ensures the client and LLM treat the result as a failure, and summarizing the error prevents context truncation from hiding the root cause.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T15:10:37.047208+00:00— report_created — created