An agentic system calls an external REST API as a tool. The API returns HTTP 503 (Service Unavailable). The agent must decide how to proceed. What is the correct error handling pattern in the orchestration layer?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — c is correct because 503 is a retriable transient error — exponential backoff gives the downstream service time to recover without flooding it with requests. If retries are exhausted, returning a structured error tool_result with error type and retry count gives Claude the information needed to decide whether to try an alternative approach, inform the user, or gracefully degrade.
Full explanation below image
Full Explanation
C is correct because 503 is a retriable transient error — exponential backoff gives the downstream service time to recover without flooding it with requests. If retries are exhausted, returning a structured error tool_result with error type and retry count gives Claude the information needed to decide whether to try an alternative approach, inform the user, or gracefully degrade. B is wrong because immediate retries without delay can overwhelm a service that is already under load — 503 specifically indicates the service needs time to recover; immediate retries worsen the situation. A is wrong because returning the 503 immediately without retry wastes an opportunity to handle transient failures transparently — many 503s resolve within 1-2 seconds; discarding them on first occurrence degrades reliability. D is wrong because silently skipping tool calls without informing Claude produces an agent that operates with incomplete information — Claude may generate an answer assuming the tool succeeded, leading to incorrect outputs.