> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agntix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Tool

> Partially update a tool. Changes take effect immediately on all agents using the tool.

<Note>
  Every endpoint on this page requires either a Clerk-issued JWT (`Authorization: Bearer <token>`) or
  an organization API key (`x-api-key: pk_…`). Anonymous calls return `401 Unauthorized`. See
  [Authentication](/authentication) for the full setup.
</Note>

<Note>
  Changes to a tool's `ajvPropertiesSchema` or `description` are picked up on the **next conversation turn** — already-open sessions are not affected mid-conversation.
</Note>

## Code examples

<CodeGroup>
  ```bash curl theme={null}
  curl -X PATCH https://api.agntix.ai/v1/chat/tools/550e8400-e29b-41d4-a716-446655440000 \
    -H "x-api-key: pk_live_••••" \
    -H "Content-Type: application/json" \
    -d '{
      "description": "Retrieves the current account balance and pending transactions. Call when user asks about their balance, available credit, or recent charges.",
      "ajvPropertiesSchema": {
        "type": "object",
        "properties": {
          "customerId": { "type": "string", "description": "Customer ID" },
          "includeTransactions": { "type": "boolean", "default": false, "description": "Include recent transactions" }
        },
        "required": ["customerId"]
      }
    }'
  ```

  ```javascript Node.js theme={null}
  const toolId = '550e8400-e29b-41d4-a716-446655440000';

  const updated = await fetch(`https://api.agntix.ai/v1/chat/tools/${toolId}`, {
    method: 'PATCH',
    headers: {
      'x-api-key': 'pk_live_••••',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      description: 'Retrieves balance and pending transactions.',
      preExecutionMessage: "Checking your balance and recent transactions...",
    }),
  }).then(r => r.json());
  ```

  ```python Python theme={null}
  import httpx

  tool_id = "550e8400-e29b-41d4-a716-446655440000"

  updated = httpx.patch(
      f"https://api.agntix.ai/v1/chat/tools/{tool_id}",
      headers={"x-api-key": "pk_live_••••"},
      json={
          "description": "Retrieves balance and pending transactions.",
          "preExecutionMessage": "Checking your balance...",
      },
  ).json()
  ```
</CodeGroup>

## Sample response

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "GET_ACCOUNT_BALANCE",
  "description": "Retrieves the current account balance and pending transactions.",
  "type": "API_TOOL",
  "orgId": "org_2abc123",
  "createdAt": "2026-04-29T10:00:00Z",
  "updatedAt": "2026-04-29T11:30:00Z"
}
```


## OpenAPI

````yaml PATCH /v1/chat/tools/{id}
openapi: 3.0.3
info:
  title: Agntix API
  version: 1.0.0
  description: >-
    The Agntix API lets you build, deploy, and operate AI chat and voice agents.
    All requests are sent to `https://api.agntix.ai`. Authenticate with an API
    key (`x-api-key`) or a Clerk-issued JWT (`Authorization: Bearer <token>`).


    Base URL: `https://api.agntix.ai`
servers:
  - url: https://api.agntix.ai
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Agents
    description: >-
      Create and manage AI agents — the core building block of Agntix. An agent
      encapsulates a system prompt, LLM, tools, knowledge store, and voice
      configuration.
  - name: Chat
    description: >-
      Open chat sessions with an agent and exchange messages. Supports streaming
      responses over SSE.
  - name: Voice
    description: >-
      List available voices and TTS/STT models, and create real-time voice
      sessions.
  - name: Tools
    description: >-
      Extend agent capabilities with API tools (webhook calls) or function tools
      (server-side logic).
  - name: Phone Numbers
    description: >-
      Provision and manage telephony numbers for inbound and outbound voice
      calls.
  - name: Models
    description: Browse available LLM, STT, and TTS models supported by Agntix.
  - name: Analytics
    description: Query call and agent-level performance metrics.
  - name: API Keys
    description: Create and manage organization-scoped API keys.
  - name: Contacts
    description: Manage customer contacts that can be linked to chat sessions.
  - name: Call Campaigns
    description: Launch and manage outbound call campaigns against a list of contacts.
  - name: Subscriptions
    description: View billing plans, usage quotas, and manage Stripe subscriptions.
paths:
  /v1/chat/tools/{id}:
    patch:
      tags:
        - Tools
      summary: Update tool
      description: >-
        Partially updates a tool. Changes take effect immediately on all agents
        that use the tool.
      operationId: updateTool
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateToolRequest'
            example:
              description: Retrieves the current account balance and pending transactions.
              ajvPropertiesSchema:
                type: object
                properties:
                  customerId:
                    type: string
                  includeTransactions:
                    type: boolean
                    default: false
                required:
                  - customerId
      responses:
        '200':
          description: Updated tool.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tool'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    UpdateToolRequest:
      type: object
      description: All fields optional — only provided fields are updated.
      properties:
        name:
          type: string
        description:
          type: string
        apiTool:
          type: object
        functionTool:
          type: object
        ajvPropertiesSchema:
          type: object
        preExecutionMessage:
          type: string
    Tool:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
          example: GET_ACCOUNT_BALANCE
        description:
          type: string
        type:
          type: string
          enum:
            - API_TOOL
            - FUNCTION_TOOL
        ajvPropertiesSchema:
          type: object
        orgId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: NOT_FOUND
            message:
              type: string
              example: Resource not found.
            status:
              type: integer
              example: 404
        meta:
          type: object
          properties:
            requestId:
              type: string
            timestamp:
              type: string
              format: date-time
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: VALIDATION_ERROR
              message: fullName should not be empty
              status: 400
            meta:
              requestId: req_01j3m...
              timestamp: '2026-04-29T10:00:00Z'
    Unauthorized:
      description: Missing or invalid authentication credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: UNAUTHORIZED
              message: Authentication required.
              status: 401
            meta:
              requestId: req_01j3m...
              timestamp: '2026-04-29T10:00:00Z'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: NOT_FOUND
              message: Agent not found.
              status: 404
            meta:
              requestId: req_01j3m...
              timestamp: '2026-04-29T10:00:00Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Organization API key. Obtain from the
        [dashboard](https://app.agntix.ai/settings/api-keys). Format:
        `pk_live_…`
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Clerk-issued JWT. Use `Authorization: Bearer <token>`.'

````