Tool calling
Tool calling
Tool calling (function calling) lets the model return a structured request to call one of your functions. Your program runs it and hands the result back to the model.
Define tools
Return the result
After running the function, append its result as a tool message and call the model again:
Controlling tool use
Protocol differences
With the Anthropic Messages API, pass tools in Anthropic format (name, description, input_schema); the model returns tool_use content blocks. For cross-protocol calls (for example Chat Completions to a Claude model), the gateway converts tool definitions and results automatically.
Not every model supports tool calling. Filter the model catalog by tool support.