> ## 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 Tool

> Create a new tool for a bot. Tools extend bot capabilities with actions like API calls, call transfers, SMS sending, etc.



## OpenAPI

````yaml post /v1/bots/{bot_uid}/tools
openapi: 3.1.0
info:
  title: OpenMic v1 External API
  description: >-
    API specification for OpenMic v1 External API, providing endpoints for bot
    management, call handling, and phone number operations.
  version: 1.0.0
servers:
  - url: https://api.openmic.ai
    description: Production Environment
security:
  - api_key: []
tags:
  - name: Calls
    description: Endpoints related to phone call creation and management.
  - name: Bots
    description: Endpoints related to bot management and configuration.
  - name: Phone Numbers
    description: Endpoints related to phone number management and bot linking.
  - name: Knowledge Bases
  - name: FAQs
  - name: Campaigns
  - name: Tools
  - name: Contact Lists
  - name: Contacts
  - name: Voices
    description: >-
      Endpoints for browsing available text-to-speech voices. Voices are
      read-only and can be filtered by gender, provider, language, and accent.
  - name: SMS
    description: Endpoints for sending SMS messages.
paths:
  /v1/bots/{bot_uid}/tools:
    post:
      tags:
        - Tools
      summary: Create Tool
      description: >-
        Create a new tool for a bot. Tools extend bot capabilities with actions
        like API calls, call transfers, SMS sending, etc.
      operationId: createToolExt
      parameters:
        - name: bot_uid
          in: path
          required: true
          schema:
            type: string
          description: The unique identifier of the bot.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateToolRequest'
      responses:
        '201':
          description: Tool created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolResponse'
        '400':
          description: Invalid request (missing fields, validation error)
        '404':
          description: Bot not found
components:
  schemas:
    CreateToolRequest:
      type: object
      required:
        - type
        - name
      description: >-
        Create a tool for a bot. Each tool type has different required fields
        and `static_params` structure. See the `x-tool-examples` section for
        complete examples of each type.
      properties:
        type:
          $ref: '#/components/schemas/ToolType'
        name:
          type: string
          maxLength: 255
          description: Tool name (max 255 characters).
        description:
          type: string
          description: >-
            Description of what the tool does. This is shown to the AI to help
            it decide when to use the tool.
        url:
          type: string
          description: API endpoint URL. **Required for `api_request` type.**
        method:
          type: string
          enum:
            - get
            - post
          description: HTTP method for API requests. Defaults to `get`.
        api_timeout:
          type: integer
          minimum: 1
          description: Request timeout in milliseconds.
        parameters:
          type: object
          description: >-
            JSON schema defining the tool's input parameters. The AI will
            extract these from the conversation.
        use_raw_schema:
          type: boolean
          description: >-
            If true, `parameters` is used as-is without transformation. This
            setting takes precedence over the type-derived default. Set to
            `true` for `function` type tools.
        static_params:
          type: object
          description: >-
            Static configuration that varies by tool type. See examples below
            for each type's schema.
        speak_during_execution:
          type: boolean
          default: true
          description: If true, bot speaks a filler message while tool executes.
        speak_after_execution:
          type: boolean
          default: true
          description: If true, bot announces the result after execution.
        async:
          type: boolean
          default: false
          description: If true, tool runs asynchronously without blocking the conversation.
      x-tool-examples:
        - title: api_request - Make HTTP requests to external APIs
          description: >-
            Use this to call external REST APIs. The bot extracts parameters
            from the conversation and sends them to your endpoint. **Required:
            `url`**
          value:
            type: api_request
            name: get_order_status
            description: Look up the status of a customer order by order ID
            url: https://api.example.com/orders/status
            method: post
            api_timeout: 10000
            parameters:
              type: object
              properties:
                order_id:
                  type: string
                  description: The order ID to look up
              required:
                - order_id
            speak_during_execution: true
            speak_after_execution: true
        - title: function - Custom function with raw JSON schema
          description: >-
            Use this when you need full control over the function schema.
            **Required: `use_raw_schema: true`, `parameters`**
          value:
            type: function
            name: calculate_quote
            description: Calculate a price quote based on customer requirements
            use_raw_schema: true
            parameters:
              type: object
              properties:
                service_type:
                  type: string
                  enum:
                    - basic
                    - premium
                    - enterprise
                quantity:
                  type: integer
                  minimum: 1
              required:
                - service_type
                - quantity
        - title: end_call - Terminate the current call
          description: >-
            Ends the call gracefully with an optional goodbye message.
            **static_params: `{ end_message: string }`**
          value:
            type: end_call
            name: end_call
            description: >-
              End the call when the customer says goodbye or the conversation is
              complete
            static_params:
              end_message: Thank you for calling. Goodbye!
        - title: transfer_call - Transfer the call to another number
          description: >-
            Transfers the call to a specified phone number. **static_params: `{
            routing_rules, default_transfer_number, transfer_type }`**
          value:
            type: transfer_call
            name: transfer_to_sales
            description: >-
              Transfer the call to the sales team when customer wants to make a
              purchase
            static_params:
              routing_rules: >-
                When customer wants to buy or make a purchase, transfer to
                +15551234567
              default_transfer_number: '+15551234567'
              transfer_type: cold
            speak_during_execution: false
            speak_after_execution: false
        - title: dtmf - Send DTMF tones (keypad presses)
          description: >-
            Sends touch-tone digits during the call, useful for IVR navigation.
            **static_params: `{ digits: string }`**
          value:
            type: dtmf
            name: press_digits
            description: Press keypad digits when navigating phone menus
            static_params:
              digits: '1'
        - title: send_sms - Send an SMS message
          description: >-
            Sends a text message to a phone number during the call.
            **static_params: `{ message: string }`**
          value:
            type: send_sms
            name: send_confirmation_sms
            description: Send appointment confirmation via SMS when customer books
            static_params:
              message: >-
                Your appointment has been confirmed for {{appointment_date}} at
                {{appointment_time}}. Reply CANCEL to cancel.
            speak_during_execution: true
            speak_after_execution: true
        - title: send_email - Send an email
          description: >-
            Sends an email during the call. **static_params: `{ to, subject,
            body }`**
          value:
            type: send_email
            name: send_quote_email
            description: Email a price quote to the customer
            static_params:
              to: '{{customer_email}}'
              subject: Your Price Quote from Acme Corp
              body: >-
                Thank you for your interest. Your quote for {{service_type}} is
                ${{quote_amount}}.
        - title: call_booking - Book a calendar appointment
          description: >-
            Creates a booking in an integrated calendar system (e.g., Clio,
            Zoho). **static_params: `{ calendar_integration, duration_minutes
            }`**
          value:
            type: call_booking
            name: book_appointment
            description: Book an appointment when customer requests to schedule a meeting
            static_params:
              calendar_integration: clio
              duration_minutes: 30
        - title: check_calendar_availability - Check available time slots
          description: >-
            Queries the calendar system for available appointment slots.
            **static_params: `{ calendar_integration, days_ahead }`**
          value:
            type: check_calendar_availability
            name: check_availability
            description: >-
              Check available appointment times when customer asks about
              availability
            static_params:
              calendar_integration: clio
              days_ahead: 14
        - title: check_working_hours - Check if within business hours
          description: >-
            Determines if the current time is within configured working hours.
            Useful for routing after-hours calls. **static_params: `{ timezone,
            working_hours }`**
          value:
            type: check_working_hours
            name: check_business_hours
            description: Check if calling during business hours to route appropriately
            static_params:
              timezone: America/New_York
              working_hours:
                monday:
                  start: '09:00'
                  end: '17:00'
                tuesday:
                  start: '09:00'
                  end: '17:00'
                wednesday:
                  start: '09:00'
                  end: '17:00'
                thursday:
                  start: '09:00'
                  end: '17:00'
                friday:
                  start: '09:00'
                  end: '17:00'
                saturday:
                  start: closed
                  end: closed
                sunday:
                  start: closed
                  end: closed
    ToolResponse:
      type: object
      properties:
        id:
          type: integer
          description: Unique numeric ID of the tool.
        type:
          $ref: '#/components/schemas/ToolType'
        name:
          type: string
        description:
          type: string
        url:
          type: string
        method:
          type: string
        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
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ToolType:
      type: string
      description: >-
        The type of tool that determines its behavior and required
        configuration.
      enum:
        - api_request
        - function
        - end_call
        - transfer_call
        - dtmf
        - send_sms
        - send_email
        - call_booking
        - check_calendar_availability
        - check_working_hours
  securitySchemes:
    api_key:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key authentication. Include your API key in the Authorization header
        as: `Authorization: Bearer <your-api-key>`

````