Claude Certified Architect – Foundations Practice Question 9: Tool Errors Is Error
Claude Certified Architect, Foundations · Test 1 · question 9 of 10
A tool that looks up shipment status calls a carrier API that sometimes returns a 404 for an unknown tracking number. Today the tool code raises an exception, which crashes the agent run. The team wants Claude to see the problem, explain it to the user, or try a corrected tracking number. What is the right handling?
Show answer and explanation
Answer:
B is correct. A tool_result block has an optional is_error field; setting it to true with a descriptive message (for example, that the tracking number was not found and what format is expected) lets Claude see the failure inside the loop and recover, by retrying with a corrected input, trying another tool, or explaining the issue to the user.
A is wrong because infinite silent retries hide the failure from Claude and can hang the run or hammer the carrier API. C is wrong because it discards the chance for recovery; Claude could have fixed the input or explained the problem. D is wrong because an empty result with no error flag is ambiguous and may be read as a successful lookup with nothing to report, which invites wrong conclusions.
Reference: Handle tool calls - Claude Platform Docs