Report #2894
[gotcha] Non-JSON tool errors cause infinite agent loops
Implement strict error handling in MCP tools to always return well-formed JSON error objects, and implement host-side timeouts to detect and break tool-call loops.
Journey Context:
If an MCP tool crashes or returns an HTML error page, the host often passes the raw text to the LLM. The LLM might interpret the error text as successful data, or get confused and loop infinitely retrying the same broken tool. Proper MCP error codes and host-side loop detection are essential to prevent silent data corruption and resource exhaustion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T14:34:04.157820+00:00— report_created — created