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

# Create a tool for an agent

> Adds a new tool to the agent's toolset.

When `type` is `api_request`, the `url` field is **required**.



## OpenAPI

````yaml post /v2/agents/{agent_uid}/tools
openapi: 3.0.3
info:
  title: OpenMic External API v2
  version: '2.0'
  description: >-
    The OpenMic External API (v2) provides programmatic access to agents, calls,

    phone numbers, tools, contact lists, campaigns, and voices.


    ## Authentication

    All endpoints require an API key passed as a Bearer token in the

    `Authorization` header:

    ```

    Authorization: Bearer <your_api_key>

    ```


    ## Rate Limiting

    Most endpoints are limited to **100 requests per minute** per organization.

    The `POST /create-phone-call` endpoint has a stricter limit of **5 requests
    per minute**.
  contact:
    name: OpenMic Support
servers:
  - url: https://api.openmic.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Verify API key identity.
  - name: Agents
    description: Create and manage voice AI agents.
  - name: Calls
    description: Initiate and track phone calls.
  - name: Phone Numbers
    description: Manage phone numbers and agent assignments.
  - name: Tools
    description: Manage agent tools (API requests, call transfers, etc.).
  - name: Contact Lists
    description: Manage contact lists and individual contacts.
  - name: Campaigns
    description: Create and manage outbound dialing campaigns.
  - name: Voices
    description: Browse available voices for agents.
  - name: SMS
    description: Send SMS messages.
paths:
  /v2/agents/{agent_uid}/tools:
    parameters:
      - name: agent_uid
        in: path
        required: true
        schema:
          type: string
        description: The agent UID.
    post:
      tags:
        - Tools
      summary: Create a tool for an agent
      description: |-
        Adds a new tool to the agent's toolset.

        When `type` is `api_request`, the `url` field is **required**.
      operationId: createTool
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateToolRequest'
            example:
              type: api_request
              name: lookup_order
              description: Look up the status of a customer order.
              url: https://api.yourapp.com/orders/status
              method: post
              parameters:
                type: object
                properties:
                  order_id:
                    type: string
                required:
                  - order_id
              speak_during_execution: true
      responses:
        '201':
          description: Tool created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    CreateToolRequest:
      type: object
      required:
        - type
        - name
      properties:
        type:
          $ref: '#/components/schemas/ToolType'
        name:
          type: string
          minLength: 1
          maxLength: 255
        description:
          type: string
        url:
          type: string
          description: Required when `type` is `api_request`.
        method:
          type: string
          enum:
            - get
            - post
        api_timeout:
          type: integer
        parameters:
          type: object
        use_raw_schema:
          type: boolean
        static_params:
          type: object
        speak_during_execution:
          type: boolean
        speak_after_execution:
          type: boolean
        async:
          type: boolean
    ToolResponse:
      type: object
      required:
        - id
        - type
        - name
        - created_at
        - updated_at
      properties:
        id:
          type: integer
        type:
          $ref: '#/components/schemas/ToolType'
        name:
          type: string
        description:
          type: string
        url:
          type: string
          description: Required when `type` is `api_request`.
        method:
          type: string
          enum:
            - get
            - post
        api_timeout:
          type: integer
        parameters:
          type: object
          description: JSON Schema object describing the tool parameters.
        use_raw_schema:
          type: boolean
        static_params:
          type: object
        speak_during_execution:
          type: boolean
        speak_after_execution:
          type: boolean
        async:
          type: boolean
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ToolType:
      type: string
      enum:
        - api_request
        - function
        - end_call
        - transfer_call
        - dtmf
        - send_sms
        - send_email
        - call_booking
        - check_calendar_availability
        - check_working_hours
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
        details:
          type: string
  responses:
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource does not exist.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded.
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              message:
                type: string
              error:
                type: string
              retryAfter:
                type: integer
    InternalServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key obtained from the OpenMic dashboard.

````