What Is Tool Use?
Every response you have seen so far has Claude working from what it already knows. Tool use changes that fundamentally. Tool use lets you define functions — tools — that Claude can call when it needs information it does not have or actions it cannot perform itself. Claude does not execute the function. It identifies which tool to call, extracts the right arguments from the user’s message, and tells your application to run it. Your application executes the function, passes the result back, and Claude incorporates it into a final response. This is how AI applications connect to the real world.A Real Example
User: “What is the current price of Bitcoin?” Without tool use:“I don’t have access to real-time data, so I cannot tell you the current price of Bitcoin.”With tool use:
“The current price of Bitcoin (BTC) is $97,432.18 USD.”The difference is a
get_crypto_price tool that Claude called, your application executed, and Claude used to answer accurately.
The Two-Request Lifecycle
Tool use always takes two requests:Request 1 — Define Your Tools
Pass tool definitions in thetools array alongside the user message:
Anatomy of a Tool Definition
Each tool has three required fields:name
The function identifier. Use snake_case. Claude uses this to identify which tool it is calling.description
The most important field. Claude reads this to decide whether and how to use the tool. Write it as if explaining the function to a junior developer — be specific about what it does and when to use it.input_schema
A JSON Schema object defining the tool’s parameters — their names, types, descriptions, and which are required:Response 1 — The Tool Use Block
When Claude decides a tool is needed it stops generating text and returns atool_use content block:
stop_reason: "tool_use" — generation stopped because a tool call is needed. This is your signal to execute the function.
content[0].type: "tool_use" — the response contains a tool call, not text. Your application should never try to display this as a user-facing response.
content[0].input — Claude extracted "BTC" from “What is the current price of Bitcoin?” automatically based on your tool description and schema. You did not parse the user’s message — Claude did.
Save the
content[0].id value — toolu_01.... You need it in Request 2 in two places. The IDs must match exactly or the request will fail.Your Application Executes the Function
Between Request 1 and Request 2, your application runs the actual function:Request 2 — Pass the Tool Result
Send the full conversation history including Claude’s tool call and your result:type: "tool_result" and the matching tool_use_id.
Response 2 — Final Answer
Claude reads the tool result and generates a natural language response:stop_reason returns to end_turn — the tool use cycle is complete. Claude incorporated the real data into a natural, helpful response.
Multiple Tools
Define multiple tools in a single request. Claude selects the right one automatically:tool_use blocks in a single response. Your application executes each function and passes all results back in Request 2.
Token Cost of Tool Use
Tool definitions are included in input tokens on every request — whether Claude uses the tool or not:
Tool use is significantly more token-intensive than standard messaging. Keep tool definitions concise — especially the
description and parameter descriptions. Every unnecessary word costs tokens on every request.
Controlling Tool Selection
Usetool_choice to control when and how Claude uses tools:
any or tool when you need guaranteed tool usage — for example, when your application requires structured output that only comes from a specific tool.
Common Use Cases
Further Reading
Tool Use API Reference
Interactive playground for testing tool use requests
Streaming
Combine streaming and tool use for real-time agent applications
System Prompts
Use system prompts to control when and how Claude uses tools
Error Handling
Handle tool use errors and failed tool calls gracefully