Report #27662
[tooling] Tool hits 429 Rate Limit returns raw error to agent causing agent to fail task or loop infinitely on immediate retry
Implement transparent exponential backoff with jitter inside the tool handler: base 100ms \* 2^attempt, max 60s, max 5 attempts. Only surface error to agent after exhaustion. Respect Retry-After headers
Journey Context:
External APIs \(GitHub, Stripe, AWS\) enforce rate limits. When a tool immediately bubbles up a 429 error to the LLM agent, the agent lacks the context to implement proper backoff—it might try a different tool that also hits the limit, or retry immediately in a tight loop wasting tokens. The correct pattern is 'transparent retries' inside the tool implementation. Use exponential backoff \(100ms, 200ms, 400ms... up to 60s\) with random jitter to avoid thundering herd. Parse the Retry-After header if present. Only return an error to the agent if all retries exhaust \(typically 5-7 attempts\). This keeps the agent loop focused on high-level logic while the tool handles resilience. This mirrors AWS SDK retry policies but applied to MCP tool scope.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:49:33.188546+00:00— report_created — created