Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Describe the retry and backoff strategy a production MCP client should use for tools/call failures. What is the critical safety constraint that distinguishes safe retries from dangerous ones?
Retry transport-level JSON-RPC failures with exponential backoff and jitter, but never blindly retry a side-effecting tool; idempotency is the constraint that decides whether a retry is safe.
Imagine you mail a letter asking the bank to move $100, and you never get a reply. Did the bank get it or not? If you mail a second letter to be safe, you might move $200. That is the whole problem with retrying tool calls. Some requests are safe to resend, like asking 'what is my balance?', because asking twice changes nothing. Others, like 'send the money', are dangerous to resend, because the first one may have already worked. A careful client waits a bit longer between retries so it does not flood the bank, and it only resends the safe kind of letter. For the risky kind, it attaches a unique ticket number so the bank can spot a duplicate and ignore it.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 min: classify transport vs tool errors, map JSON-RPC codes to permanent vs transient, apply backoff with jitter, gate on idempotency with keys, then add a per-server circuit breaker and timeout budgets.
| Aspect | Transport-level failure | Tool-level failure |
|---|---|---|
| Shape | JSON-RPC error object or dead socket | Normal result with isError: true |
| Round trip | Did not complete cleanly | Completed; tool reported a domain error |
| Retryable? | Transient ones yes, with backoff and jitter | Usually no; same inputs give same error |
| Outcome certainty | Ambiguous; side effect may have committed | Known; the tool definitely ran |
| Right move | Gate retry on idempotency, use a key if needed | Surface to the model, do not swallow |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Retrying every failed tools/call uniformly. A timeout on a side-effecting tool may have already succeeded, so a blind retry double-executes the side effect.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.