Returning a tool result after a get_weather tool_use block

CCDV-F Tools & MCP Medium Question 25 of 105

Claude returns stop_reason: "tool_use" with a tool_use block whose id is toolu_01Abc and whose name is get_weather. The application runs the function and gets back "72F and sunny".

What must the next request append to the conversation history?

Show answer and explanation

CA user message whose first block is a tool_result carrying that tool_use id.

Results go back in a user message as tool_result blocks, those blocks must come first in the content array, and tool_use_id must match the id from the tool_use block so Claude can pair result with request. The Claude API has no tool or function role; it folds tool use into the user and assistant messages, which is what distinguishes it from other function-calling APIs. Leading with a text block returns a 400. And omitting the id breaks the pairing even when only one call is outstanding.

Source: platform.claude.com/docs/en/agents-and-tools/tool-use/handl…

Anonymous, no account needed. Your tally stays in this browser.

Next question Start 5 timed questions Browse all 105 original CCDV-F practice questions