Tools

Update a tool

Update a tool's definition. Propagates live to every agent that references this tool (their config cache is busted on update).

patch/tool/{toolId}

Path parameters

toolIdstring required

The tool id, format tool_<24 lowercase alphanumerics>.

Request body

Example request

{
  "definition": {
    "name": "get_order_status",
    "description": "Look up a customer's order by id and read back its status.",
    "url": "https://api.example.com/orders",
    "method": "GET",
    "headers": {
      "Authorization": "Bearer TOKEN",
      "Content-Type": "application/json"
    },
    "headersArray": [
      {
        "key": "Authorization",
        "value": "Bearer TOKEN"
      }
    ],
    "queryParams": [
      {
        "key": "id",
        "value": "{{order_id}}"
      }
    ],
    "requestBody": "{\"customer_id\": \"{{customer_id}}\"}",
    "responseVariables": [
      {
        "variableName": "orderStatus",
        "jsonPath": "$.data.status"
      }
    ],
    "auth": {
      "token": "ORDER_API_TOKEN",
      "name": "X-API-Key",
      "value": "SEARCH_API_KEY"
    },
    "fillerPhrases": [
      "Let me check that for you",
      "One moment please"
    ]
  }
}

Response

Tool updated.

statusboolean

Example response

{
  "status": true,
  "data": {
    "_id": "6a86c89eb3073ea15c328ce0",
    "toolId": "tool_ab12cd34ef56gh78ij90kl12",
    "organizationId": "6a5f9c9fcf10167aad404c40",
    "type": "api_call",
    "definition": {
      "name": "get_order_status",
      "description": "Look up a customer's order by id and read back its status.",
      "url": "https://api.example.com/orders",
      "method": "GET",
      "headers": {
        "Authorization": "Bearer TOKEN",
        "Content-Type": "application/json"
      },
      "headersArray": [
        {
          "key": "Authorization",
          "value": "Bearer TOKEN"
        }
      ],
      "queryParams": [
        {
          "key": "id",
          "value": "{{order_id}}"
        }
      ],
      "requestBody": "{\"customer_id\": \"{{customer_id}}\"}",
      "responseVariables": [
        {
          "variableName": "orderStatus",
          "jsonPath": "$.data.status"
        }
      ],
      "auth": {
        "token": "ORDER_API_TOKEN",
        "name": "X-API-Key",
        "value": "SEARCH_API_KEY"
      },
      "fillerPhrases": [
        "Let me check that for you",
        "One moment please"
      ]
    }
  }
}

Changes