Define HTTP API calls as named tools with typed parameters.
The API tool type lets you define custom tools that make HTTP requests to external APIs. Each tool you define gets a name, a description, typed parameters, and a URL template. The agent calls these tools by name without needing to construct the HTTP request itself.This is useful for integrating agents with REST APIs that don’t have an MCP server, and for quick prototyping before building a full MCP integration.
agents: assistant: model: openai/gpt-4o description: Assistant with weather access instruction: You can look up current weather information. toolsets: - type: api api_config: name: get_weather method: GET endpoint: "https://api.weather.example/v1/current?city=${city}" instruction: Get current weather for a city args: city: type: string description: City name required: [city] headers: Authorization: "Bearer ${env.WEATHER_API_KEY}"
The URL. Use ${param} to interpolate parameter values. For GET requests, parameters can be interpolated into the URL. For POST requests, parameters are sent as JSON in the request body.
Add multiple api toolset entries to give the agent access to several endpoints:
api-tool.yaml
agents: root: model: google/gemini-2.5-pro description: Chess.com daily puzzle agent instruction: | Call the daily-puzzle tool and print the puzzle. Do not solve it — only provide hints. toolsets: - type: api api_config: name: daily-puzzle method: GET endpoint: https://api.chess.com/pub/puzzle instruction: Get today's chess puzzle output_schema: type: object properties: title: type: string url: type: string fen: type: string description: Board state in FEN notation
File uploads and multipart forms are not supported.
API keys and tokens in headers are visible in debug logs. Always use ${env.VAR} to reference secrets from the environment rather than hardcoding them in configuration files.
For APIs that need OAuth flows, pagination, or complex request handling, use an MCP server instead. See MCP toolsets for details.