Report #8627
[gotcha] Infinite retry loop on MCP tool schema validation errors
Catch schema validation errors from the MCP server and inject a specific, corrective error message back into the LLM context, along with a strict retry limit \(e.g., max 2 retries\). If it fails, abort the tool path.
Journey Context:
LLMs often generate slightly malformed JSON for tool arguments \(e.g., a string true instead of boolean true, or missing a required field\). The MCP server rejects it with a validation error. The LLM sees the error, tries to fix it, makes a different mistake, and loops indefinitely. Without a hard retry limit and clear error formatting, the agent burns tokens until it hits a max context limit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:06:19.768490+00:00— report_created — created