Claude tool calling lets you define callable functions that Claude can choose to invoke during generation. You define aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/anthropic/llms.txt
Use this file to discover all available pages before exploring further.
Tool with a name, description, and input schema, attach it to a generation request, and Claude responds with a tool_use content block when it decides to call the tool. The SDK maps that block to a ToolCallPart in the response, which your application can inspect and execute.
Basic Tool
Define a tool withTool::make(), declare its input schema, and register a handler with ->run(). Attach the tool to a generation request using ->tool().
$result->finishReason is FinishReason::ToolCalls and $result->parts contains a ToolCallPart with the tool name and decoded argument array.
Wire Format
AnthropicToolConverter::convert() maps each Tool object to the shape required by the Anthropic API:
tool_result blocks nested inside a user message:
Multiple Tools
Pass multiple tools at once using->tools() with an array:
Tool result messages use
Message::ROLE_TOOL internally. The SDK converts them to Anthropic’s user / tool_result message format automatically — you do not need to construct the wire format yourself.