Tool calling
Let your application connect models to useful functions.
Define a tool
Provide a function name, description, and JSON schema in tools. When the model returns a tool call, your application validates its arguments and decides whether to execute it.
{
"type": "function",
"function": {
"name": "get_project",
"description": "Read a project by ID",
"parameters": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
]
}
}
}Complete the loop
- Send your messages and tool definitions.
- Add the assistant message containing its tool calls to the conversation.
- Run approved tools in your application.
- Return each result as a tool message with its matching
tool_call_id. - Ask the model to continue.
Execution boundaries
The inference API does not execute tools itself. Keep permissions, validation, timeouts, and spending controls in your application. Studio and agent-team interfaces remain previews where explicitly labeled.
Availability depends on your connected provider. Check service status and keep x-request-id with your diagnostics.