Imagine a customer asks your Claude-powered support assistant, “Where is order A123?” Claude can understand the question, but the latest shipping status lives in your order system. Give Claude an order lookup tool and it can request that record, then use the result to explain where the package is.
What Is Tool Use / Function Calling in Claude?
Tool use, also called function calling, lets Claude request operations provided by your application or by Anthropic. You tell Claude which tools are available and what inputs they expect. When Claude chooses a tool, it generates a structured request with the arguments needed for the operation.
With the default tool_choice setting of auto, Claude can call a tool or answer directly. A question about your return policy may call for a knowledge base search. A question about a specific shipment calls for an order lookup.
Client Tools vs. Server Tools
Understanding Client Tools
Client tools run in your application. You can define a custom tool to check inventory, search internal articles, or retrieve an invoice. Claude requests the operation, and your application checks permissions, runs the corresponding code, and returns the result.
Understanding Server Tools
Server tools run on Anthropic’s infrastructure. For example, Claude can use Anthropic’s web search tool to find public information and cite sources in its answer.
| Feature | Client tools | Server tools |
|---|---|---|
| Where execution runs | Your application | Anthropic’s infrastructure |
| Typical use | Business APIs and internal data | Hosted capabilities such as web search |
| Who handles execution | Your application validates and runs the call | Anthropic runs the operation |
Core Capabilities and How They Work Together
Define the Tool
For a custom client tool, the Messages API tool definition includes a name, a description, and an input_schema. The description tells Claude when to use the tool, and the schema describes the arguments it should supply.
Handle the Tool Call
When Claude requests a client tool, the response includes a tool_use block containing the tool name, input, and call ID. Your application validates the arguments, checks the user’s permissions, and routes the request to the corresponding function or API.
Return the Result
Keep Claude’s assistant response in the conversation, then send a user message containing a tool_result block. Its tool_use_idmust match the original call ID. Claude uses that result to respond or request another operation. The Claude SDK’s tool runner can manage this exchange for client tools.
Common Use Cases and Real-World Applications
-
Customer Support – A support assistant can check delivery status or search help-center articles. For an order lookup, the application verifies that the customer can access the order before returning its shipping details.
-
Retail and Inventory – When a shopper asks which stores have a product in stock, Claude can request current inventory for the selected locations and summarize the available options.
-
Web Research – Claude can call Anthropic’s web search tool to find public information that changes over time and cite the sources it used.
Benefits for Developers and Users
Developers can expose specific operations with predictable inputs, then apply their own authorization and logging rules at execution time. Users can ask questions in natural language and receive answers grounded in the systems that hold the relevant data. For workflows with several steps, Claude can use one result to decide which tool to call next.
Getting Started with Claude Tool Use
Start with a read-only client tool such as get_order_status. The following JSON snippets show the tool definition and the exchange your application handles through the Messages API.
Define the Order Lookup Tool
Include this object in the request’s tools array.
{
"name": "get_order_status",
"description": "Retrieve the latest shipping status for an order the current customer can access.",
"input_schema": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "The order identifier provided by the customer."
}
},
"required": ["order_id"]
}
}
| Field | Value |
|---|---|
| name | get_order_status |
| description | Retrieve the latest shipping status for an order the current customer can access. |
| input_schema.type | object |
| order_id property | string. The order identifier provided by the customer. |
| input_schema.required | [“order_id”] |
Execute the Requested Lookup
If the customer asks about order A123, Claude may return this block. Your application reads the arguments and checks that the authenticated customer can access the order before querying the order system.
{
"type": "tool_use",
"id": "toolu_order_lookup",
"name": "get_order_status",
"input": {
"order_id": "A123"
}
}
Send the Result Back to Claude
Append Claude’s full assistant response to the message history. Add a user message with the following block in its contentarray, then send the conversation back to the Messages API.
{
"type": "tool_result",
"tool_use_id": "toolu_order_lookup",
"content": "Order A123 shipped and is expected to arrive on Tuesday."
}
Claude can then answer, “Your order has shipped and is expected to arrive on Tuesday.”
Conclusion
Tool use lets Claude answer questions and complete tasks that depend on external data. In the order-tracking example, Claude requests a lookup for order A123, your application verifies the customer’s access and retrieves the shipping status, and Claude uses the result to explain when the package will arrive.
The same pattern works for checking inventory, searching internal documentation, or retrieving invoices. Claude handles the conversation and generates structured requests, while your application controls what each client tool can access and execute.
Reference:
https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview












