v1

latestOpenAPI 3.0.1MIT2026-07-26104203277.0 KB

Create Web Tool

Creates a new web tool for a project. Web tools can be of type FUNCTION, MCP, or WEB_TOOL.

post/v2/voice-agents/web-tool

Request body

type'FUNCTION' | 'MCP' | 'WEB_TOOL' required

The type of web tool to create

namestring required

The name of the web tool

descriptionstring

A description of what the web tool does

collectionIdstring uuid

Optional collection ID to group the web tool

asyncboolean

Whether the tool runs asynchronously. Required for FUNCTION type, not allowed for MCP type.

Example request

{
  "type": "FUNCTION",
  "name": "Get Weather Data",
  "description": "Fetches current weather data for a given location",
  "collectionId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
  "toolSettings": {
    "serverUrl": "https://api.example.com/weather",
    "methodType": "GET",
    "authToken": "Bearer sk-...",
    "timeOut": 5,
    "httpHeaders": {
      "Content-Type": "application/json"
    },
    "pathParameters": {
      "city": "london"
    }
  },
  "messages": [
    {
      "type": "REQUEST_START",
      "content": "Fetching weather data..."
    }
  ],
  "params": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "The city name to get weather for"
      },
      "units": {
        "type": "string",
        "description": "Temperature units",
        "enum": [
          "celsius",
          "fahrenheit"
        ]
      }
    },
    "required": [
      "location"
    ]
  }
}

Response

Web tool created successfully

successboolean
messagestring
messageKeystring

Example response

{
  "success": true,
  "message": "Web tool created successfully",
  "messageKey": "WebToolCreatedSuccessfully",
  "data": {
    "id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "persistentId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "version": 1,
    "name": "Get Weather Data",
    "type": "FUNCTION",
    "userId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "projectId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "isActive": true,
    "description": "Fetches current weather data for a given location",
    "collectionId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "messages": [
      {
        "type": "REQUEST_START",
        "content": "Fetching weather data..."
      }
    ]
  }
}