Guides
Tool calling
Send function definitions only to a model whose catalog metadata explicitly includes tool support.
Define a tool
Chat request
{
"model": "YOUR_APPROVED_MODEL_ID",
"messages": [
{
"role": "user",
"content": "What is the weather in Paris?"
}
],
"max_tokens": 256,
"tools": [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Look up weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string"
}
},
"required": [
"city"
]
}
}
}
],
"tool_choice": "auto"
} Run the tool loop
- Read the assistant's tool_calls from the response.
- Validate the requested function and arguments in your own application.
- Obtain any authorization required for the action, then execute the tool.
- Send the tool result back with the matching tool_call_id.
The gateway relays tool definitions and results. It does not run tools. Treat model output and tool arguments as untrusted input.
Capability errors
A model without verified tool support returns an unsupported_capability error when tools or tool messages are supplied. Check the catalog before enabling a client's tool mode.