Question 1
A support agent asks Claude to look up a customer's order. The Messages response contains a `tool_use` block with `id=toolu_order_4` and stops with `stop_reason=tool_use`; it has not answered the customer. Which TWO actions should the application's client-tool loop take next? Select TWO answers.
Explanation
Correct Answers
The application is responsible for executing client-defined tools after a `tool_use` stop. It should inspect the named tool and arguments, enforce input and authorization constraints, and execute the requested lookup in its own environment. A stop for tool use is a handoff, not a completed assistant answer. Without actually running the lookup, the model has no reliable order status to incorporate into a response. This action is necessary but must be paired with a correctly correlated tool result.
The tool result must reference the exact `tool_use.id` returned by Claude, and the conversation should retain the assistant tool-use turn before the new user-role result block. On resubmission, Claude can reason about the order record and either request another tool or formulate a final answer. The protocol requires this handoff rather than pretending the lookup was an ordinary user statement. A client loop should keep processing tool use until an appropriate final stop occurs.
Incorrect Answers
A `tool_use` block is an instruction to the client application, not a human-readable confirmation of delivery or payment. The stop reason explicitly indicates that a tool operation remains to be serviced. Displaying it as the final answer would leak implementation details and give the customer no verified order information; it also leaves Claude without the actual lookup result.
An assistant message containing arbitrary lookup text does not satisfy the tool-result contract. Claude must be able to correlate a result block with the originating `tool_use` identifier, especially when several tools can be called. Removing the identifier obscures provenance and risks malformed history or misassociation of customer records; the proper response uses a user-role `tool_result` block.
Resubmitting the original question without the pending tool-use message or a result discards the state that triggered the lookup. Claude may request the same action again because it has no evidence of completion. A functioning loop keeps the ordered conversation history and supplies the executed result, not a clean restart masquerading as progress.