Question 1
A claims agent sends a Messages API request and receives stop_reason=tool_use with an issue_refund tool call. What should the application do before asking Claude to continue?
- Send the same user request again without the tool result
- Execute the tool and return a tool_result matching its tool_use id
- Convert the tool_use input into a final customer-facing message
- Treat the assistant response as a completed refund and close the case
Explanation
Correct Answer
B:The model requested a client-side action rather than completing its response. The host executes it and supplies the matched result in the next message before continuation.
Incorrect Answers
A:Replaying the request hides whether execution succeeded. The model needs the outcome of the specific outstanding call to make its next decision.
C:Tool arguments are intended for the application executor. Presenting them as a completed outcome bypasses authorization, execution and verification.
D:A tool-use stop marks an operation request, not proof that a refund occurred. Closing now would create a false confirmation without the backend result.
Question 2
A document extraction agent replies with stop_reason=end_turn and an ordinary text answer without tool calls. Which loop decision best respects the API response?
- Execute the last tool again as a precaution
- Return the completed answer and stop the current agent turn
- Keep polling for a tool_use stop_reason
- Insert a fictitious empty tool_result to force another turn
Explanation
Correct Answer
B:An end_turn response says the assistant has finished this turn. Continuing unconditionally wastes calls and could generate contradictory text after a valid response.
Incorrect Answers
A:An earlier action does not need replay solely because the model finished. Retrying a write can introduce duplicate side effects or inconsistent records.
C:The termination signal is already present. Waiting for a different stop reason can create a loop that never ends despite successful completion.
D:Tool results must correspond to actual prior tool_use identifiers. A fabricated response breaks the expected request-result pairing.
Question 3
A research summary stops with stop_reason=max_tokens in the middle of a numbered list. The application must not publish incomplete prose. What is the most appropriate response?
- Assume the summary is complete because no tool_use block exists
- Execute a random available tool to restart generation
- Change the stop reason to end_turn in local logs
- Treat it as truncated and continue under a completion policy
Explanation
Correct Answer
D:The token boundary ended generation rather than indicating task completion. A controlled continuation or revised budget must precede publication and should be validated for completeness.
Incorrect Answers
A:Absence of a tool request does not mean the response finished successfully. max_tokens specifically signals that generation hit its configured limit.
B:A tool invocation has no direct relationship to completing truncated text. It can add irrelevant side effects and consume the remaining budget.
C:Rewriting metadata cannot restore missing content. It conceals a termination condition that the application's reliability logic must handle.
Question 4
A claims workflow receives several model responses with requested client-side actions. Which TWO pieces of protocol information are essential to drive and correlate execution correctly? Choose TWO.
- The tool_use id for each requested client operation
- The stop_reason indicating whether a tool call is requested
- The number of markdown headings in the last message
- The alphabetic order of the available tool names
- The apparent friendliness of the assistant's introductory text
Explanation
Correct Answers
A:The matching identifier connects the executor's result to the original tool call. Without it parallel operations cannot be reliably reconciled.
B:Tool-use termination distinguishes an operation request from a completed assistant turn. The controller must interpret that signal before proceeding.
Incorrect Answers
C:Presentation markup has no defined relationship to requested tool execution. The protocol uses structured blocks and stop reasons.
D:Tool names help selection, but their list order does not correlate individual calls with tool results or decide when to stop.
E:Tone is not a control-flow signal. A polite preamble may accompany a pending tool call and does not establish execution state.
Question 5
An integration keeps looping after a tool failure because its code checks only whether the assistant message contains text. Which condition should drive the next step?
- Retry the entire conversation without passing the failure back
- Infer task completion whenever a text block precedes a tool call
- Use stop_reason, tool_use blocks and the real tool failure
- Delete all text blocks and mark the turn successful
Explanation
Correct Answer
C:Tool calls and ordinary text can coexist in a response. The controller must honor the tool-use signal and let the model see recoverable failures.
Incorrect Answers
A:A replay lacking failure evidence may repeat the same operation. Structured feedback is needed to support repair or escalation.
B:A textual preamble does not cancel a later tool invocation. The pending action still needs a result before the user receives a definitive outcome.
D:Stripping content does not resolve outstanding tools. Success depends on executing the requested actions and verifying their results.
Question 6
A customer agent must stop after at most six tool rounds even if the model keeps asking for more. Where should that limit be enforced?
- In the host loop with a counter and a defined limit outcome
- By erasing prior tool messages after every second call
- Only in a system prompt that asks Claude not to exceed six rounds
- By assuming end_turn always arrives before the sixth call
Explanation
Correct Answer
A:A deterministic application counter can stop unbounded tool cycles regardless of model behavior. It can then surface a controlled failure or human handoff.
Incorrect Answers
B:Removing history can disrupt call-result pairing and cause repetition. It does not provide an actual hard cap on execution.
C:Prompts influence choices but do not enforce hard iteration limits. A malformed response or miscount can still exceed the operational budget.
D:Completion timing depends on tool outcomes and task difficulty. Nothing in the stop reason contract guarantees termination within an arbitrary number of rounds.
Question 7
A billing connector returns an error from its API, but the agent loop replaces it with the string Success before resuming. What is the primary architectural defect?
- The system failed to increase the model's output token budget
- The response should have been returned as a system message
- The loop converts failed external execution into false success evidence
- The agent should have chosen a different model before handling the result
Explanation
Correct Answer
C:Reliable agents must preserve the distinction between request, observation and verified outcome. Fabricated success can cause downstream actions based on nonexistent payments.
Incorrect Answers
A:More generation capacity cannot correct deliberately inaccurate tool feedback. The error is in execution-result handling rather than response length.
B:A high-priority instruction is not a substitute for a factual tool observation. It would further distort the conversation state.
D:Model selection does not repair the untruthful interface contract. Every model needs the real executor result to act responsibly.
Question 8
A custom API tool call needs approval from a policy service. Claude produced stop_reason=tool_use; approval is pending. What should the coordinator do?
- Execute the call immediately because the model already requested it
- Replace tool_use with a speculative text acknowledgment
- Return end_turn without disclosing the pending action
- Await policy approval and return the actual decision
Explanation
Correct Answer
D:Tool-use output expresses intent, not authorization. The host must gate the side effect and communicate approval or denial as an observable tool result.
Incorrect Answers
A:Language-model selection is not a policy decision. Sensitive actions remain subject to application-side authorization before any side effect.
B:A natural-language acknowledgment cannot stand in for a completed or rejected policy check. Users could wrongly infer that the action ran.
C:Silently ending drops a requested operation and provides no accurate status. The workflow needs an explicit outcome or pending-state handling.
Question 9
An agent uses a client-side database search tool. Where should the database query actually execute when the Messages API returns a tool_use block?
- Inside the model weights without application participation
- Only after an end_turn response has been emitted
- In application-controlled code that implements the declared tool
- In the browser renderer from a printed explanation field
Explanation
Correct Answer
C:The model supplies structured arguments; the host remains responsible for executing a client tool against its own database and returning observations.
Incorrect Answers
A:Client tools do not execute inside the language model. Treating a generated tool call as execution would produce no real query result.
B:A tool_use response asks the host to run the tool before the model can finish. Waiting for end_turn reverses the tool cycle.
D:Rendering text is separate from backend execution. It would also risk exposing sensitive data-access capabilities to an inappropriate runtime.
Question 10
A developer is designing a tool-use loop that may encounter intermittent failures. Which state must be retained to resume safely after a process restart?
- Only the user's most recent question
- Only the assistant's most optimistic final draft
- Only a count of generated text tokens
- Tool-use IDs, execution status and conversation state
Explanation
Correct Answer
D:A durable checkpoint distinguishes attempted side effects from unexecuted calls. That prevents replaying writes and lets follow-up tool results attach to the correct requests.
Incorrect Answers
A:The current prompt alone cannot reveal which tool operations already ran. Restarts could duplicate billing or produce context-free replies.
B:A speculative draft does not certify which external operations completed. Persisting it without tool state encourages false completion claims.
C:Token totals provide no mapping to actions and outcomes. Execution recovery requires the actual call state rather than a usage statistic.