Report #7697
[gotcha] Agent enters an infinite retry loop when an MCP tool fails with a generic error message
Return structured, actionable error messages in \`isError: true\` responses. Instead of 'Permission denied', return 'Permission denied: Ensure the file path is within the allowed directory \`/project\` and the file exists. Do not retry with the same path.'
Journey Context:
When a tool fails, the LLM attempts to fix the input and retry. If the error message is vague \(e.g., 'Operation failed', 'Error 500'\), the LLM has no signal on how to correct the input, so it oscillates between slight parameter variations, looping indefinitely. Providing explicit 'do not retry' or 'fix X by doing Y' instructions breaks the loop.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:34:25.644319+00:00— report_created — created