Tool calling lets models invoke functions you define. Gateway passes your tool definitions to the model, the model suggests which tool to call with what arguments, and your application executes it and sends back the result. This works consistently across vendors, with capability checks applied to the exact execution route before the request is sent upstream.
Tools are defined as function objects with a name, description, and a JSON Schema for the parameters.
When the model calls a tool, the response contains a tool_use content block with finish_reason: "tool_use".
After executing the function, send the result back with a tool_result input to continue the conversation.
Control whether and how the model uses tools.
Tool calling works through the OpenAI SDK with a simple update of changing the base url and API key.
Tool calling works with the Vercel AI SDK using the tool() helper and Zod schemas.
Use GET /v1/models and inspect vendors.<vendor>.capabilities.supports_tool_calling for the exact route you plan to use.
Yes. The response may contain multiple tool_use content blocks. Send a tool_result for each one before continuing the conversation.
No. Tool parameter schemas are passed directly to the provider. Validation is handled by the model and your application.
Gateway validates tool support against the exact vendor route that will serve the request. Use GET /v1/models and inspect vendors.<vendor>.capabilities.supports_tool_calling and vendors.<vendor>.capabilities.supports_tool_choice when deciding whether to send tools or a specific tool_choice value.