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

# Toggle Agent Tool

> Enable or disable a single built-in or custom tool for a V2 chat agent. Identify the tool by the (tool_name, source) pair from List Agent Tools. Requires a token with write access.



## OpenAPI

````yaml PATCH /v1/agents/{id}/tools
openapi: 3.0.0
info:
  title: Conduit API
  version: 1.0.0
  description: Public API for Conduit.
servers:
  - url: https://api.conduit.ai
    description: Production
security: []
tags:
  - name: meta
    description: Discovery and API metadata endpoints.
  - name: agents
    description: >-
      V2 chat agent configuration, including instructions, skills, triggers, and
      automation behavior.
  - name: contacts
    description: >-
      Contact profile and contact-scoped related resources such as tickets and
      calls.
  - name: workspaces
    description: Workspaces accessible to the current API token.
  - name: escalations
    description: >-
      Chat escalations that require operator review, including message, proposed
      response, and disposition context when available.
  - name: conversations
    description: >-
      Canonical message threads. Use these endpoints to list threads, inspect
      conversation state, read transcripts, and send replies.
  - name: tickets
    description: >-
      Operational queue items tied to conversations, including ticket-scoped
      transcripts and replies.
  - name: calls
    description: Phone call records, transcripts, summaries, and recordings when available.
  - name: reservations
    description: >-
      PMS reservations synced from the workspace's integrations (Hostaway,
      Guesty, Airbnb, etc.), including guest identity, payment status, and stay
      dates.
  - name: appointments
    description: >-
      Scheduled appointments (bookings) backed by the Conduit booking service.
      Exposes allocation context and the upstream booking-service `external_id`.
  - name: helpdesk_tickets
    description: >-
      Helpdesk tickets mirrored from external helpdesk integrations (Zendesk,
      Pylon, Plain), including requester identity and upstream metadata.
  - name: kb
    description: >-
      Knowledge base search and node management. Nodes represent knowledge base
      entries (files or directories), chunks are the indexed retrieval units
      used by search.
  - name: skills
    description: >-
      Workspace agent skills that can be attached to V2 chat agents.
      Sidebar/global-assistant skills are intentionally excluded.
  - name: custom_tools
    description: >-
      Custom code tools: user-authored Python/JavaScript functions executed in a
      sandbox when an agent calls them. Includes a runtimes endpoint describing
      the entrypoint signature, return shape, and available dependencies per
      language.
paths:
  /v1/agents/{id}/tools:
    patch:
      tags:
        - agents
      summary: Toggle a tool for an agent
      description: >-
        Enable or disable a single built-in or custom tool for a V2 chat agent.
        Requires a token with write access.
      operationId: setAgentToolAccess
      parameters:
        - schema:
            type: string
            description: V2 chat agent id.
            example: ag77c0dy0mgdpzmqz6tesry8w184002s
          required: true
          name: id
          in: path
        - schema:
            type: string
            example: j57demo8f8x7c9v0n2q4r6t8y1u3i5o
            description: >-
              Optional workspace override. If omitted, Conduit resolves the
              agent's workspace automatically.
          required: false
          name: workspace_id
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tool_name:
                  type: string
                  minLength: 1
                  description: >-
                    Name of the tool to toggle, as returned by `GET
                    /v1/agents/{id}/tools`.
                source:
                  type: string
                  enum:
                    - builtin
                    - custom
                  description: >-
                    `builtin` for a platform tool from the `tools` catalog,
                    `custom` for a workspace custom code tool.
                enabled:
                  type: boolean
                  description: >-
                    Set true to enable the tool for this agent, false to
                    disable.
              required:
                - tool_name
                - source
                - enabled
              description: >-
                Enable or disable a single tool for a V2 chat agent. The
                (tool_name, source) pair identifies the tool.
              example:
                tool_name: lookup-order-status
                source: custom
                enabled: true
      responses:
        '200':
          description: Updated tool access
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Underlying tool id (builtin or custom tool).
                      name:
                        type: string
                        description: Tool name the agent references, unique per source.
                      source:
                        type: string
                        enum:
                          - builtin
                          - custom
                        description: >-
                          `builtin` for a platform tool from the `tools`
                          catalog, `custom` for a workspace custom code tool.
                      description:
                        type: string
                      enabled:
                        type: boolean
                        description: >-
                          Whether this tool is currently enabled for this agent.
                          Chat agents default to disabled (opt-in).
                      domain:
                        type: string
                        nullable: true
                        description: Built-in tool domain; null for custom tools.
                      tags:
                        type: array
                        items:
                          type: string
                      language:
                        type: string
                        nullable: true
                        enum:
                          - python
                          - javascript
                        description: Custom tool runtime; null for built-in tools.
                    required:
                      - id
                      - name
                      - source
                      - description
                      - enabled
                      - domain
                      - tags
                      - language
                required:
                  - data
                description: The tool's resolved access state after the change.
                example:
                  data:
                    id: kg77c0dy0mgdpzmqz6tesry8w184002s
                    name: lookup-order-status
                    source: custom
                    description: Look up the fulfillment status of an order by id.
                    enabled: true
                    domain: null
                    tags: []
                    language: python
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                  - error
                description: Standard error response.
                example:
                  error: Invalid workspace id
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Token
      description: >-
        Conduit API token. Use `Authorization: Bearer <token>`. Read/write
        endpoints require a token with write access.

````