Skip to content

Tools API

Manage agent tools, including OpenAPI import and tool clusters.

Endpoints

MethodEndpointDescription
GET/api/agents/{id}/toolsList tools
POST/api/agents/{id}/toolsCreate tool
POST/api/agents/{id}/tools/import-openapiImport OpenAPI spec
DELETE/api/agents/{id}/tools?id={toolId}Delete tool
DELETE/api/agents/{id}/tools/cluster/{name}Delete tool cluster

List Tools

bash
GET /api/agents/{id}/tools

Returns all tools sorted by cluster, then name.

Response

json
{
  "success": true,
  "data": [
    {
      "id": "tool-123",
      "name": "getPetById",
      "description": "Get pet by ID",
      "type": "http",
      "configuration": {
        "baseUrl": "https://petstore.swagger.io/v2",
        "pathTemplate": "/pet/{petId}",
        "method": "GET",
        "pathParams": ["petId"],
        "queryParams": []
      },
      "isEnabled": true,
      "cluster": "Petstore"
    }
  ]
}

Create Tool

bash
POST /api/agents/{id}/tools
Content-Type: application/json

Request Body

json
{
  "name": "search_database",
  "description": "Search the knowledge base for information",
  "type": "http",
  "configuration": {
    "url": "https://api.example.com/search",
    "method": "POST",
    "headers": "{\"Authorization\": \"Bearer ...\"}"
  },
  "cluster": "my_api"
}

The cluster field is optional. If provided, the tool is grouped under that cluster name.

Import OpenAPI Spec

bash
POST /api/agents/{id}/tools/import-openapi
Content-Type: application/json

Request Body

json
{
  "url": "https://petstore.swagger.io/v2/swagger.json",
  "cluster": "petstore"
}
FieldTypeRequiredDescription
urlstringOne of url or specURL to an OpenAPI 3.x JSON spec
specobjectOne of url or specInline OpenAPI spec object
clusterstringNoGroup name for imported tools. Defaults to info.title from the spec

Response

json
{
  "success": true,
  "data": [
    {
      "id": "uuid-1",
      "name": "getPetById",
      "description": "Find pet by ID",
      "type": "http",
      "configuration": {
        "baseUrl": "https://petstore.swagger.io/v2",
        "pathTemplate": "/pet/{petId}",
        "method": "GET",
        "pathParams": ["petId"],
        "queryParams": []
      },
      "isEnabled": true,
      "cluster": "petstore"
    }
  ]
}

What Gets Created

For each path + HTTP method combination in the spec:

  • Tool name: operationId from the spec, or auto-generated as {method}_{path_slug}
  • Description: summary or description from the operation
  • Configuration: baseUrl, pathTemplate, method, pathParams, queryParams
  • Type: Always http

Delete Tool

bash
DELETE /api/agents/{id}/tools?id={toolId}

Deletes a single tool by ID.

Delete Tool Cluster

bash
DELETE /api/agents/{id}/tools/cluster/{clusterName}

Deletes all tools belonging to a cluster.

Response

json
{
  "success": true,
  "data": {
    "deleted": 5
  }
}

Tool Types

TypeDescription
httpHTTP endpoint call (including OpenAPI-imported tools)
javascriptCustom JavaScript function
mcpMCP server tool

Tool Configuration Fields

HTTP Tools (manual)

FieldDescription
urlFull endpoint URL
methodHTTP method (GET, POST, PUT, DELETE)
headersJSON string of request headers

HTTP Tools (OpenAPI-imported)

FieldDescription
baseUrlBase server URL from the spec
pathTemplatePath with parameter placeholders (e.g. /pet/{petId})
methodHTTP method
pathParamsArray of path parameter names
queryParamsArray of query parameter names