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

# create tool

> Create a new tool for function calling in persona sessions



## OpenAPI

````yaml https://api.anam.ai/swagger.json post /v1/tools
openapi: 3.1.0
info:
  title: Anam AI API
  version: '1.0'
servers:
  - url: https://api.anam.ai
    description: Anam API
security:
  - BearerAuth: []
tags:
  - name: Sessions
  - name: Avatar Videos
  - name: Meetings
  - name: Personas
  - name: Avatars
  - name: Voices
  - name: Pronunciation Dictionaries
  - name: LLMs
  - name: Knowledge
  - name: Tools
  - name: Share Links
  - name: Engine
paths:
  /v1/tools:
    post:
      tags:
        - Tools
      summary: create tool
      description: Create a new tool for function calling in persona sessions
      operationId: createTool
      requestBody:
        description: >-
          Tool definition. `config` depends on `type`. For example:
          `{"name":"lookup_order","description":"Look up an order by its
          number","type":"SERVER_WEBHOOK","config":{"url":"https://api.example.com/orders","method":"POST","awaitResponse":true,"parameters":{"type":"object","properties":{"orderId":{"type":"string","description":"The
          caller's order number"}},"required":["orderId"]}}}`.
        required: true
        content:
          application/json:
            examples:
              default:
                $ref: '#/components/examples/ToolCreate'
              webhook:
                $ref: '#/components/examples/ToolCreateWebhook'
            schema:
              type: object
              required:
                - name
                - description
                - type
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: >-
                    Name the LLM calls the tool by. Characters other than
                    letters, digits, `_`, `.` and `-` (spaces included) are
                    saved as `_`, with repeated `_` merged and any at either end
                    dropped; names starting with `anam_` are reserved. Names
                    needn't be unique: when a persona has two tools with one
                    name, its sessions add `_2`, `_3` and so on.
                  example: search_knowledge_base
                description:
                  type: string
                  minLength: 1
                  maxLength: 1024
                  description: >-
                    Description of what the tool does. Used by the LLM to decide
                    when to call it.
                  example: >-
                    Search the knowledge base for information about products and
                    services
                type:
                  type: string
                  enum:
                    - CLIENT
                    - SERVER_RAG
                    - SERVER_WEBHOOK
                  description: >-
                    `CLIENT` sends the call to the client SDK, `SERVER_RAG`
                    searches knowledge folders and `SERVER_WEBHOOK` calls a URL.
                    `SYSTEM` tools (end_call, interrupt) are Anam's own and
                    can't be created.
                  example: SERVER_RAG
                disableInterruptions:
                  type: boolean
                  description: >-
                    The user can't interrupt the persona while this tool runs.
                    Defaults to false.
                  default: false
                  example: false
                config:
                  $ref: '#/components/schemas/ToolConfigInput'
      responses:
        '201':
          description: Successfully created tool
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tool'
              examples:
                default:
                  $ref: '#/components/examples/ToolResponse'
        '400':
          description: Bad request - Invalid tool data
        '401':
          description: Unauthorized - Invalid or missing API key
        '403':
          description: Forbidden - API key lacks the required permission
        '500':
          description: Server error
        '503':
          description: >-
            The API key could not be checked because of a temporary server
            problem. The key may be valid; retry after `Retry-After` seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableError'
components:
  examples:
    ToolCreate:
      summary: Register a client-side tool the persona can trigger
      value:
        name: open_calendar
        description: Open the calendar UI in the client app.
        type: CLIENT
        config:
          parameters:
            type: object
            properties:
              date:
                type: string
                description: Date to jump to, in YYYY-MM-DD format.
    ToolCreateWebhook:
      summary: Register a webhook the persona calls with the caller's order number
      value:
        name: lookup_order
        description: Look up an order by its number.
        type: SERVER_WEBHOOK
        config:
          url: https://api.example.com/orders
          method: POST
          headers:
            Authorization: Bearer YOUR_API_TOKEN
          awaitResponse: true
          parameters:
            type: object
            properties:
              orderId:
                type: string
                description: The caller's order number.
            required:
              - orderId
    ToolResponse:
      summary: A single tool definition
      value:
        id: 00000000-0000-0000-0000-000000000000
        name: open_calendar
        description: Open the calendar UI in the client app.
        type: CLIENT
        config:
          parameters:
            type: object
            properties:
              date:
                type: string
                description: Date to jump to, in YYYY-MM-DD format.
        createdAt: '2026-04-20T10:00:00.000Z'
        updatedAt: null
        usageCount: 0
  schemas:
    ToolConfigInput:
      description: >-
        Settings in the shape for the tool's `type`; fields of other shapes are
        stored but not used. `null` saves an empty config.
      anyOf:
        - title: CLIENT
          type: object
          description: For `CLIENT`, the client SDK receives the call as an event.
          properties:
            parameters:
              type: object
              description: JSON Schema of the arguments the model passes to the client.
            awaitResult:
              type: boolean
              description: Wait for the client to send a result back. Defaults to false.
            toolTimeoutSeconds:
              type: number
              minimum: 1
              maximum: 600
              description: >-
                Seconds to wait for the result when `awaitResult` is true.
                Defaults to 10.
        - title: SERVER_RAG
          type: object
          description: >-
            For `SERVER_RAG`. The model passes only a search query; these
            settings are fixed, and omitted or null ones use the defaults.
          properties:
            documentFolderIds:
              type: array
              items:
                type: string
                format: uuid
              description: Knowledge folder IDs to search.
              example:
                - 67d27a9f-0ce1-4432-848b-8ab2b97f024b
            topK:
              type:
                - integer
                - 'null'
              minimum: 1
              maximum: 100
              description: Most matching chunks to retrieve.
              example: 5
            minScore:
              type:
                - number
                - 'null'
              minimum: 0
              maximum: 1
              description: Lowest relevance score a chunk needs. Zero is valid.
              example: 0.5
            maxContextTokens:
              type:
                - integer
                - 'null'
              minimum: 1
              maximum: 200000
              description: >-
                Token budget for retrieved text, excluding metadata and prompt
                formatting.
              example: 4000
            neighborChunks:
              type:
                - integer
                - 'null'
              minimum: 0
              maximum: 10
              description: >-
                Chunks to add after each match, plus the one before it, for
                context. 0 (the default) returns matches only. On update,
                omitting it keeps the stored value and null sets 0.
              example: 0
        - title: SERVER_WEBHOOK
          type: object
          description: >-
            For `SERVER_WEBHOOK`. The engine calls `url` when the model decides
            to.
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: Public HTTPS URL to call.
              example: https://api.example.com/webhook
            method:
              type: string
              enum:
                - GET
                - POST
                - PUT
                - DELETE
                - PATCH
              default: POST
              description: HTTP method.
            headers:
              type: object
              additionalProperties:
                type: string
              description: Headers sent with each request, such as `Authorization`.
            parameters:
              type: object
              description: >-
                JSON Schema (`type` `object` with `properties`) of the JSON body
                the model fills in; each property's `description` tells it what
                to send.
            queryParameters:
              type: object
              description: JSON Schema of the query string values the model fills in.
            awaitResponse:
              type: boolean
              default: true
              description: >-
                Wait for the response and give it to the model. Defaults to
                true.
            bodyTemplate:
              type: string
              description: >-
                Stored but not sent. The body is the JSON of the values the
                model fills in for `parameters`.
        - type: 'null'
    Tool:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the tool
          example: 00000000-0000-0000-0000-000000000000
        name:
          type: string
          description: Name of the tool
          example: search_knowledge_base
        description:
          type: string
          description: Description of what the tool does
          example: Search the knowledge base for product information
        type:
          type: string
          enum:
            - CLIENT
            - SERVER_RAG
            - SERVER_WEBHOOK
            - SYSTEM
          description: Type of tool
        config:
          type: object
          description: Type-specific configuration
        disableInterruptions:
          type: boolean
          description: When true, interruptions are disabled while this tool is executing
          default: false
        createdAt:
          type: string
          format: date-time
          description: When the tool was created
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the tool was last updated
        usageCount:
          type: integer
          description: Number of the organization's live personas using this tool
    ServiceUnavailableError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          example: Service temporarily unavailable
        message:
          type: string
          example: We could not check your API key. Please retry shortly.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.