Tool Use & Function Calling — Agent Reference

Schemas, parallel execution, result handling, and parameters for Claude function calling.

What is the correct JSON schema format for Claude tool definitions?

Claude tool schemas follow the JSON Schema Draft 4 specification. Place descriptions on all properties to help Claude select th...

Last verified: July 2026

How do you handle parallel tool calls in Claude?

When Claude decides to call multiple tools in a single turn, the API returns a message block containing multiple content blocks...

Last verified: July 2026

How do you return a tool result to Claude?

Return tool results in a user message block containing a list of content blocks of type 'tool_result'. Each block must specify ...

Last verified: July 2026

Can Claude call the same tool multiple times in one turn?

Yes. If Claude needs to fetch multiple independent data points, it will return multiple tool_use blocks referencing the same to...

Last verified: July 2026

How do you force Claude to use a specific tool?

Force Claude to use a specific tool by setting the request parameter 'tool_choice' to type 'tool' and providing the name of the...

Last verified: July 2026

What is tool_choice and how do you use it?

tool_choice governs how Claude selects tools. Use 'auto' to let Claude decide whether to use tools, 'any' to force Claude to se...

Last verified: July 2026

How do you handle tool call errors gracefully?

To report a tool execution failure to Claude, return a user message block with the parameter 'is_error' set to true. This tells...

Last verified: July 2026

What is the maximum number of tools Claude supports per request?

Claude officially supports up to 100 tools per single API request. However, including many tools increases system prompt token ...

Last verified: July 2026

How do you define nested objects in Claude's tool schema?

Define nested structures by nesting object properties inside properties in your tool definition, matching the JSON Schema Draft...

Last verified: July 2026

How do tool definitions affect input token billing?

Tool schemas are serialized into XML instructions and prepended to the system prompt, counting towards your input token billing...

Last verified: July 2026

How do you handle streaming responses when tools are called?

In stream responses, listen for events of type 'content_block_start' with content type 'tool_use'. Collect arguments from 'cont...

Last verified: July 2026

How do you prevent Claude from hallucinating tool arguments?

Provide detailed descriptions for tool parameters, use enum lists for allowed values, and instruct the model in your system pro...

Last verified: July 2026

Does tool use override the custom system prompt in Claude?

No. The system prompt guidelines and rules remain active and guide Claude's behavior even when the model decides to use tools.

Last verified: July 2026

What temperature is recommended when using Claude for tool calling?

Set the temperature to 0.0 when using tools. This ensures arguments are generated reliably and matches the target schemas witho...

Last verified: July 2026

What is the difference between tool_choice auto and any?

tool_choice 'auto' allows Claude to choose whether to write a text response or execute a tool, whereas 'any' forces Claude to c...

Last verified: July 2026

Common questions

What is the correct JSON schema format for Claude tool definitions?

Claude tool schemas follow the JSON Schema Draft 4 specification. Place descriptions on all properties to help Claude select the correct tool and generate matching parameters.

How do you handle parallel tool calls in Claude?

When Claude decides to call multiple tools in a single turn, the API returns a message block containing multiple content blocks of type 'tool_use'. Iterate through the list, execute them in parallel, and return corresponding tool result blocks.

How do you return a tool result to Claude?

Return tool results in a user message block containing a list of content blocks of type 'tool_result'. Each block must specify the matching 'tool_use_id' to bind the result to the initial request.

Can Claude call the same tool multiple times in one turn?

Yes. If Claude needs to fetch multiple independent data points, it will return multiple tool_use blocks referencing the same tool name but with distinct arguments and unique tool_use_ids.

How do you force Claude to use a specific tool?

Force Claude to use a specific tool by setting the request parameter 'tool_choice' to type 'tool' and providing the name of the target tool.