CCAR-F scenarios › Customer Support Resolution Agent · Question 2 of 60

Scenario 1 · Customer Support Resolution Agent

You're building a support agent with the Claude Agent SDK that resolves ambiguous customer requests such as returns, billing disputes, and account problems. It reaches your backend through custom MCP tools: get_customer, lookup_order, process_refund, and escalate_to_human. The goal is to resolve at least 80% of contacts on first touch while recognizing the cases a human should take over.

Agentic Architecture & Orchestration

Your loop around the support agent ends the conversation whenever Claude's response contains a text block. Logs show many sessions end right after Claude writes "Let me pull up that order for you" in the same response as a lookup_order tool_use block, so the lookup never runs and the customer gets no answer. How should the loop decide when to continue?

Show answer and explanation

Answer: D — Inspect stop_reason: when it is "tool_use", execute the requested tools, append their results to the conversation, and call Claude again; end the loop only on "end_turn".

stop_reason is the loop's control signal: "tool_use" means Claude wants tool results before it continues, and "end_turn" means it has finished (task 1.1). Treating text content as a completion signal is a named anti-pattern, and so is parsing the text for phrases (a), which is brittle natural-language control flow. Banning text next to tool calls (b) relies on the model to keep the loop correct and still checks the wrong signal. A fixed iteration count (c) is an arbitrary cap used as the main stopping mechanism: it cuts off cases that need more steps and wastes calls on cases that need fewer.