F2.1 F2

The Tool Use Dance: Six Steps, Three API Calls

Tool use in the Claude API is a collaboration. The model decides what to call and with what parameters. Your code actually runs it. Claude never touches your database, never calls your APIs, never executes anything. It only asks.

The six-step flow

  1. Define tools — You describe available tools (name, description, input schema) in the API request.
  2. Send request — You send messages + tool definitions to the API.
  3. Model returns tool_use — The response contains a tool_use block with the tool name, parameters, and a unique ID. stop_reason is "tool_use".
  4. You execute the tool — Your code runs the actual operation (database query, API call, file read — whatever the tool does).
  5. You send the result back — You add the tool result as a user message with a tool_result block, referencing the original tool_use ID.
  6. Model processes the result — Claude incorporates the tool output into its next response.

A single tool call requires at minimum two API calls: the initial request (steps 1-3) and the follow-up with the result (steps 5-6). If the model chains two tools, that’s three API calls.

The model doesn’t execute anything

This is the most common misconception. The Claude API is a pure reasoning engine when it comes to tools. It generates structured requests specifying what it wants done. Execution is entirely your responsibility.

This separation is intentional. Your code controls security, rate limiting, error handling, and access control. The model handles decision-making and parameter generation. Neither side does the other’s job.

What happens with multiple tools

The model can request multiple tool calls in a single response — the content array simply contains multiple tool_use blocks. You execute all of them, then send all results back in one message (multiple tool_result blocks). Or the model might chain tools sequentially across turns: use tool A, process the result, then decide to call tool B.


One-liner: The model decides what to call and generates parameters — your code executes the tool and returns the result. Claude never runs anything itself.