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

> Adds one or more API tools to a specific agent. Use this endpoint to give an agent access to custom API tool integrations.  **Request body:** The `apiTools` array contains API tool slugs. Returns the

# Add API Tools to Agent

For the complete error reference, see [Error Guide](/rest-api/ai-agents-apis/error-codes).


## OpenAPI

````yaml patch /ai-agents/agent-builder/agents/{uid}/api-tools/add
openapi: 3.0.0
info:
  title: AI Agents APIs
  description: API reference for CometChat AI Agents service
  version: '1.0'
servers:
  - url: https://{appId}.api-{region}.cometchat.io/v3
    variables:
      appId:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: ai-agent
    description: ''
paths:
  /ai-agents/agent-builder/agents/{uid}/api-tools/add:
    patch:
      tags:
        - Agent Builder
      summary: Add API Tools to Agent
      description: >-
        Adds one or more API tools to a specific agent. Use this endpoint to
        give an agent access to custom API tool integrations.


        **Request body:** The `apiTools` array contains API tool slugs. Returns
        the updated agent object.
      operationId: AgentBuilderController_addApiToolsToAgent
      parameters:
        - name: uid
          required: true
          in: path
          description: Unique identifier of the agent
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ManageAgentApiToolsDto'
      responses:
        '200':
          description: API tools successfully added to the agent.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      uid:
                        type: string
                        example: agent-uuid-1234
                      appId:
                        type: string
                        example: my-app-id
                      name:
                        type: string
                        example: Support Agent
                      icon:
                        type: string
                        example: https://example.com/icon.png
                      isActive:
                        type: boolean
                        example: true
                      description:
                        type: string
                        example: A helpful support agent
                      tools:
                        type: array
                        items:
                          type: string
                        example:
                          - gmail
                          - slack
                      files:
                        type: array
                        items:
                          type: string
                        example: []
                      websites:
                        type: array
                        items:
                          type: string
                        example: []
                      otherKbIntegrations:
                        type: array
                        items:
                          type: string
                        example: []
                      apiTools:
                        type: array
                        items:
                          type: string
                        example: []
                      mcpServers:
                        type: array
                        items:
                          type: string
                        example: []
                      frontendActions:
                        type: array
                        items:
                          type: string
                        example: []
                      ragVersion:
                        type: string
                        enum:
                          - v1
                          - v2
                        example: v2
                      lastMessageAt:
                        type: number
                        nullable: true
                        example: 1700000000000
                      instruction:
                        type: string
                        example: You are a helpful assistant
                      formattedInstruction:
                        type: string
                        example: You are a helpful assistant
                      metaData:
                        type: object
                        example: {}
                      model:
                        type: string
                        example: gpt-4o-mini
                      modelMetaData:
                        type: object
                        example: {}
                      createdAt:
                        type: number
                        example: 1700000000000
                      updatedAt:
                        type: number
                        example: 1700000000000
              example:
                success: true
                data:
                  uid: agent-uuid-1234
                  appId: my-app-id
                  name: Support Agent
                  icon: https://example.com/icon.png
                  isActive: true
                  description: A helpful support agent
                  tools:
                    - gmail
                    - slack
                  files: []
                  websites: []
                  otherKbIntegrations: []
                  apiTools: []
                  mcpServers: []
                  frontendActions: []
                  ragVersion: v2
                  lastMessageAt: null
                  instruction: You are a helpful assistant
                  formattedInstruction: You are a helpful assistant
                  metaData: {}
                  model: gpt-4o-mini
                  modelMetaData: {}
                  createdAt: 1700000000000
                  updatedAt: 1700000000000
      security:
        - apiKey: []
components:
  schemas:
    ManageAgentApiToolsDto:
      type: object
      properties:
        apiTools:
          description: Array of API tool slugs to add or remove
          example:
            - get_weather
            - send_email
            - create_task
          type: array
          items:
            type: string
      required:
        - apiTools
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key (i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````