> ## 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: Personas
  - name: Avatars
  - name: Voices
  - name: LLMs
  - name: Knowledge
  - name: Tools
  - name: Share Links
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. The `config` object shape depends on `type` — see the
          inline `oneOf` for the shape expected for each variant.
        required: true
        content:
          application/json:
            examples:
              default:
                $ref: '#/components/examples/ToolCreate'
            schema:
              type: object
              required:
                - name
                - description
                - type
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: Unique name for the tool. Must match pattern [a-zA-Z0-9_.-]+
                  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
                    - SYSTEM
                  description: |
                    Type of tool:
                    - CLIENT: Triggers events on the client SDK
                    - SERVER_RAG: Searches knowledge base documents
                    - SERVER_WEBHOOK: Calls an external webhook URL
                    - SYSTEM: Internal system actions (end_call, interrupt)
                  example: SERVER_RAG
                disableInterruptions:
                  type: boolean
                  description: >-
                    When true, interruptions are disabled while this tool is
                    executing. Defaults to false.
                  default: false
                  example: false
                config:
                  type: object
                  description: Type-specific configuration for the tool
                  oneOf:
                    - title: ClientToolConfig
                      type: object
                      properties:
                        parameters:
                          type: object
                          description: JSON schema for parameters the LLM will provide
                        awaitResult:
                          type: boolean
                          description: >-
                            If true, engine pauses until client sends a result
                            back. Default is fire-and-forget.
                        toolTimeoutSeconds:
                          type: number
                          minimum: 1
                          maximum: 600
                          description: >-
                            Per-tool timeout in seconds when awaitResult is
                            true. Default 10s.
                    - title: ServerRagToolConfig
                      type: object
                      required:
                        - documentFolderIds
                      properties:
                        documentFolderIds:
                          type: array
                          items:
                            type: string
                            format: uuid
                          description: IDs of knowledge folders to search
                          example:
                            - 67d27a9f-0ce1-4432-848b-8ab2b97f024b
                    - title: ServerWebhookToolConfig
                      type: object
                      required:
                        - url
                        - method
                      properties:
                        url:
                          type: string
                          format: uri
                          description: Webhook URL to call
                          example: https://api.example.com/webhook
                        method:
                          type: string
                          enum:
                            - GET
                            - POST
                            - PUT
                            - DELETE
                            - PATCH
                          description: HTTP method to use
                          example: POST
                        headers:
                          type: object
                          additionalProperties:
                            type: string
                          description: Custom headers to send with the request
                        bodyTemplate:
                          type: string
                          description: Template for the request body
                    - title: SystemToolConfig
                      type: object
                      required:
                        - action
                      properties:
                        action:
                          type: string
                          enum:
                            - end_call
                            - interrupt
                          description: System action to perform
      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
        '500':
          description: Server error
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.
    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:
    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 personas using this tool
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````