Report #82035
[gotcha] Agent loops calling the same MCP tool repeatedly with slight parameter variations after an error
Track tool-call retry state externally. After 2-3 failed calls to the same tool with the same intent, inject a forced context message: 'Tool X has failed N times. Try a completely different approach.' Break the loop at the orchestration layer, not by hoping the model will notice.
Journey Context:
When a tool call fails \(wrong parameters, permission denied, resource not found\), the agent often retries with slightly modified parameters, assuming the failure is marginal. If the root cause is systematic \(wrong auth scope, missing resource, fundamental schema mismatch\), the agent loops indefinitely—each retry looks like a fresh attempt because the model has no innate retry counter. This is especially common with file-path tools \(trying path variations\) and API tools \(trying different query parameters\). The model's 'fix' strategy is usually local \(tweak the last parameter\), not global \(try a different tool or approach\). External retry tracking with forced strategy-pivot messages breaks the cycle. Simply increasing the error message verbosity doesn't work—the model reads the verbose error and still tries the same class of fix.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:17:21.772485+00:00— report_created — created