Two Tool Families
- Function tools. You define them, the model requests them, you run them and return the result. This page.
- Hosted tools. Run upstream with no round trip:
web_searchandweb_fetch. See Server-Side Tools.
Declaring a Tool
function.name must be unique in the request and parameters must be a JSON Schema object. The description is how the model decides when to call the tool.
tool_choice: "auto" (default when tools are present), "none", "required", or {"type": "function", "function": {"name": "get_weather"}}.
The Loop
A tool call is at least two requests.The model asks for a tool
tool_calls and finish_reason: "tool_calls":arguments is a JSON string; parse it. The id ties this request to the result you send back. Your code runs get_weather("Austin").Streaming
Withstream: true, tool calls arrive in fragments. The first chunk for a call carries tool_calls with index, id, type: "function", and function.name; later chunks carry function.arguments fragments under the same index. Concatenate per index, then run the loop as above. See the streaming format reference.
Privacy
Function tools work at Anonymous, Private, and Confidential on models that advertisefunction_tools. At Encrypted, function tools work with nito-encrypted-encrypt-all-fields: 1, with tool definitions and results sent as ciphertext.
Related
Chat Completions
The endpoint.
Streaming
Token by token.
Web Search
A hosted tool.
Privacy Levels
The four levels.
Chat Completions Endpoint
Schema reference.

