A city 311 resident-services desk agent must keep calling MCP tools until the resident's request is fully resolved. Which stop_reason should the loop treat as the signal to continue executing tools rather than ending the turn?
Select an answer to reveal the explanation.
Short Explanation
Think of stop_reason like a traffic light for the agent loop. When Claude says tool_use, it is yellow-go—keep driving and run the tool. end_turn is the red light that means the desk can finally answer the resident.
Full Explanation
In a city 311 resident-services agentic loop, stop_reason is the structured control signal the runtime must inspect after every model response. When stop_reason is tool_use, Claude has emitted one or more tool_use blocks and is waiting for those MCP tool results before it can finish resolving the resident request. The correct operational rule is therefore to execute the requested tools, append their results to conversation history, and continue the loop rather than treating any assistant prose as completion.
tool_use works as the continue signal because it is an API-level lifecycle state, not a free-text hint. Civic desks routinely need multi-step sequences—identity lookup, ticket creation, status check—before a resident can be answered. Continuing on tool_use keeps those steps ordered and auditable for 311 quality review.
end_turn fails as a continue signal because it means the model believes the turn is complete and no further tools are requested. Treating end_turn as keep-going would re-invoke tools after the desk should already reply to the resident, creating duplicate tickets or contradictory status messages. max_tokens is a truncation or safety condition, not evidence that more tools are required; truncated replies may need a retry or shorter prompt, but they do not imply a pending MCP call. stop_sequence reflects a custom stop-string match and is not the Anthropic agentic-loop convention for civic MCP tool orchestration; municipal agents should not invent civic-only stop words as their primary continue rule.
Exam caveat: distinguish stop_reason values (tool_use versus end_turn versus max_tokens versus stop_sequence) from natural-language content inside assistant text. Operational check: after each Claude response in the 311 loop, branch only on stop_reason—if tool_use, run tools and continue; if end_turn, return the final resident-facing answer and exit.