Skip to content

Tools

API Key Required
The Ultravox API requires an API key. For more details see Authentication.

Tools in Ultravox allow you to extend the capabilities of your AI agent by giving it access to external APIs and services. With tools, your AI can perform actions like fetching real-time data, interacting with databases, or integrating with third-party services, all while maintaining a natural conversation flow.

List Tools

GET /tools

Lists all available tools. Account scoped.

cursorPagination cursor.

Create Tool

POST /tools

Creates a new tool. Account scoped.

None

Get Tool

GET /tools/{tool_id}

Retrieves details of a specific tool. Account scoped.

tool_id
required
Unique identifier of the tool to retrieve.

Update Tool

PUT /tools/{tool_id}

Replaces an existing tool. Updating a single field in a tool is not supported. The entire tool definition must be provided. Account scoped.

tool_id
required
Unique identifier of the tool to update.

Delete Tool

DELETE /tools/{tool_id}

Deletes a specific tool. Account scoped.

tool_id
required
Unique identifier of the tool to delete.

Examples

List All Tools

Terminal window
curl --request GET \
--url 'https://api.ultravox.ai/api/tools' \
--header 'X-API-Key: aBCDef.123456'

Response

{
"next": null,
"previous": null,
"results": [
{
"toolId": "550e8400-e29b-41d4-a716-446655440000",
"name": "weather_api",
"created": "2024-09-18T10:30:00Z",
"definition": {
"description": "Get current weather information for a given location",
"dynamicParameters": [
{
"name": "location",
"location": "PARAMETER_LOCATION_QUERY",
"schema": {
"type": "string",
"description": "City name or ZIP code"
},
"required": true
}
],
"http": {
"baseUrlPattern": "https://api.weatherservice.com/v1/current",
"httpMethod": "GET"
}
}
}
]
}

Create Tools from OpenAPI (Swagger) File

Terminal window
curl -X POST -F "file=@./<your_tools_file.yaml>;type=text/yaml" \
--url https://api.ultravox.ai/api/tools \
--header 'X-API-Key: aBCDef.123456'

Create a New Tool

Terminal window
curl --request POST \
--url 'https://api.ultravox.ai/api/tools' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: aBCDef.123456' \
--data '{
"name": "stock_price",
"definition": {
"description": "Get the current stock price for a given symbol",
"dynamicParameters": [
{
"name": "symbol",
"location": "PARAMETER_LOCATION_QUERY",
"schema": {
"type": "string",
"description": "Stock symbol (e.g., AAPL for Apple Inc.)"
},
"required": true
}
],
"http": {
"baseUrlPattern": "https://api.stockmarket.com/v1/price",
"httpMethod": "GET"
}
}
}'

Response

{
"toolId": "7f1e3b78-c71e-4b1f-9c4a-b83f7683f0d2",
"name": "stock_price",
"created": "2024-09-18T14:15:22Z",
"definition": {
"description": "Get the current stock price for a given symbol",
"dynamicParameters": [
{
"name": "symbol",
"location": "PARAMETER_LOCATION_QUERY",
"schema": {
"type": "string",
"description": "Stock symbol (e.g., AAPL for Apple Inc.)"
},
"required": true
}
],
"http": {
"baseUrlPattern": "https://api.stockmarket.com/v1/price",
"httpMethod": "GET"
}
}
}

Update an Existing Tool

Terminal window
curl --request PUT \
--url 'https://api.ultravox.ai/api/tools/7f1e3b78-c71e-4b1f-9c4a-b83f7683f0d2' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: aBCDef.123456' \
--data '{
"name": "stock_price_v2",
"definition": {
"description": "Get the current stock price and company info for a given symbol",
"dynamicParameters": [
{
"name": "symbol",
"location": "PARAMETER_LOCATION_QUERY",
"schema": {
"type": "string",
"description": "Stock symbol (e.g., AAPL for Apple Inc.)"
},
"required": true
}
],
"http": {
"baseUrlPattern": "https://api.stockmarket.com/v2/price-and-info",
"httpMethod": "GET"
}
}
}'

Response

{
"toolId": "7f1e3b78-c71e-4b1f-9c4a-b83f7683f0d2",
"name": "stock_price_v2",
"created": "2024-09-18T14:15:22Z",
"definition": {
"description": "Get the current stock price and company info for a given symbol",
"dynamicParameters": [
{
"name": "symbol",
"location": "PARAMETER_LOCATION_QUERY",
"schema": {
"type": "string",
"description": "Stock symbol (e.g., AAPL for Apple Inc.)"
},
"required": true
}
],
"http": {
"baseUrlPattern": "https://api.stockmarket.com/v2/price-and-info",
"httpMethod": "GET"
}
}
}