> ## Documentation Index
> Fetch the complete documentation index at: https://domoinc-bradley-turek-pfilter-operators-reference.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tool Calling

> Process a tool calling request.



## OpenAPI

````yaml /openapi/product/AI-Services.yaml post /api/ai/v1/messages/tools
openapi: 3.1.0
info:
  title: AI Services
  description: >-
    Domo AI Services provide a consistent API to leverage Foundation Models to
    solve common problems such as natural language SQL generation (text-to-SQL),
    Summarization, Classification, Tool Calling and others.
  version: 2.3.3639_master
servers:
  - url: https://{subdomain}.domo.com
    variables:
      subdomain:
        description: The Domo instance subdomain.
        default: subdomain
security: []
tags:
  - name: AI Services - Classification
    description: Domo AI Service Classification APIs
  - name: AI Services - Data Extraction
    description: Domo AI Service Data Extraction APIs
  - name: AI Services - Embedding
    description: Domo AI Service Embedding APIs
  - name: AI Services - Image
    description: Domo AI Service Image APIs
  - name: AI Services - Messages
    description: Domo AI Service Messages APIs
  - name: AI Services - Sentiment Analysis
    description: Domo AI Service Sentiment Analysis APIs
  - name: AI Services - Text
    description: Domo AI Service Text APIs
paths:
  /api/ai/v1/messages/tools:
    post:
      tags:
        - AI Services - Messages
      summary: Tool Calling
      description: Process a tool calling request.
      operationId: toolCalling
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ToolCallRequest'
            examples:
              Initial Tool Call:
                description: Initial tool call request
                value:
                  input:
                    - role: USER
                      content:
                        - type: TEXT
                          text: Do you have any blue coats available?
                  tools:
                    - name: get_product_recommendations
                      description: >-
                        Searches for products matching certain criteria in the
                        database
                      parameters:
                        type: object
                        properties:
                          categories:
                            description: categories that could be a match
                            type: array
                            items:
                              type: string
                              enum:
                                - coats & jackets
                                - accessories
                                - tops
                                - jeans & trousers
                                - skirts & dresses
                                - shoes
                          colors:
                            description: colors that could be a match, empty array if N/A
                            type: array
                            items:
                              type: string
                              enum:
                                - black
                                - white
                                - brown
                                - red
                                - blue
                                - green
                                - orange
                                - yellow
                                - pink
                                - gold
                                - silver
                          keywords:
                            description: >-
                              keywords that should be present in the item title
                              or description
                            type: array
                            items:
                              type: string
                          price_range:
                            type: object
                            properties:
                              min:
                                type: number
                                minimum: 100
                              max:
                                type: number
                                maximum: 200
                            required:
                              - min
                              - max
                            additionalProperties: false
                          limit:
                            type: integer
                            description: >-
                              The maximum number of products to return, use 5 by
                              default if nothing is specified by the user
                            const: 100
                          today:
                            type: string
                            format: date-time
                            description: todays date
                          email:
                            type: string
                            format: email
                            description: confirmation email
                          phone:
                            type: string
                            description: user phone number
                          id:
                            type: string
                            format: uuid
                        required:
                          - categories
                          - colors
                          - keywords
                          - price_range
                          - limit
                          - today
                          - id
                        additionalProperties: false
                    - name: get_product_details
                      description: Fetches more details about a product
                      parameters:
                        type: object
                        properties:
                          product_id:
                            type: string
                            description: The ID of the product to fetch details for
                        required:
                          - product_id
                        additionalProperties: false
                    - name: add_to_cart
                      description: >-
                        Add items to cart when the user has confirmed their
                        interest.
                      parameters:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                product_id:
                                  type: string
                                  description: ID of the product to add to the cart
                                quantity:
                                  type: integer
                                  description: Quantity of the product to add to the cart
                              required:
                                - product_id
                                - quantity
                              additionalProperties: false
                        required:
                          - items
                        additionalProperties: false
                  toolChoice:
                    type: AUTO
              Tool Call Next Step Request:
                description: Tool call after function execution
                value:
                  input:
                    - role: USER
                      content:
                        - type: TEXT
                          text: I'm looking for a blue coat.
                    - role: ASSISTANT
                      content:
                        - type: TEXT
                          text: >-
                            Certainly! I'd be happy to help you find a blue
                            coat. I'll use the product recommendation tool to
                            search for that.
                        - type: TOOL_USE_REQUEST
                          toolInput:
                            categories:
                              - coats & jackets
                            colors:
                              - blue
                            keywords:
                              - coat
                            price_range:
                              min: 100
                              max: 200
                            limit: 5
                            today: '2023-06-14T12:00:00.000Z'
                            id: 550e8400-e29b-41d4-a716-446655440000
                          name: get_product_recommendations
                          toolCallId: toolu_bdrk_01DZtT8tKDafT5P5Du9AuRAL
                    - role: USER
                      content:
                        - type: TOOL_USE_RESULT
                          content:
                            - type: TEXT
                              text: '{''productName'': ''Wool Blue Coat''}'
                          toolCallId: toolu_bdrk_01DZtT8tKDafT5P5Du9AuRAL
                  tools:
                    - name: get_product_recommendations
                      description: >-
                        Searches for products matching certain criteria in the
                        database
                      parameters:
                        type: object
                        properties:
                          categories:
                            description: categories that could be a match
                            type: array
                            items:
                              type: string
                              enum:
                                - coats & jackets
                                - accessories
                                - tops
                                - jeans & trousers
                                - skirts & dresses
                                - shoes
                          colors:
                            description: colors that could be a match, empty array if N/A
                            type: array
                            items:
                              type: string
                              enum:
                                - black
                                - white
                                - brown
                                - red
                                - blue
                                - green
                                - orange
                                - yellow
                                - pink
                                - gold
                                - silver
                          keywords:
                            description: >-
                              keywords that should be present in the item title
                              or description
                            type: array
                            items:
                              type: string
                          price_range:
                            type: object
                            properties:
                              min:
                                type: number
                                minimum: 100
                              max:
                                type: number
                                maximum: 200
                            required:
                              - min
                              - max
                            additionalProperties: false
                          limit:
                            type: integer
                            description: >-
                              The maximum number of products to return, use 5 by
                              default if nothing is specified by the user
                            const: 100
                          today:
                            type: string
                            format: date-time
                            description: todays date
                          email:
                            type: string
                            format: email
                            description: confirmation email
                          phone:
                            type: string
                            description: user phone number
                          id:
                            type: string
                            format: uuid
                        required:
                          - categories
                          - colors
                          - keywords
                          - price_range
                          - limit
                          - today
                          - id
                        additionalProperties: false
                    - name: get_product_details
                      description: Fetches more details about a product
                      parameters:
                        type: object
                        properties:
                          product_id:
                            type: string
                            description: The ID of the product to fetch details for
                        required:
                          - product_id
                        additionalProperties: false
                    - name: add_to_cart
                      description: >-
                        Add items to cart when the user has confirmed their
                        interest.
                      parameters:
                        type: object
                        properties:
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                product_id:
                                  type: string
                                  description: ID of the product to add to the cart
                                quantity:
                                  type: integer
                                  description: Quantity of the product to add to the cart
                              required:
                                - product_id
                                - quantity
                              additionalProperties: false
                        required:
                          - items
                        additionalProperties: false
                  toolChoice:
                    type: AUTO
        required: true
      responses:
        '200':
          description: Successful tool calling response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessagesAIResponse'
              examples:
                Tool Calling Response:
                  description: Tool Calling Response
                  value:
                    content:
                      - type: TEXT
                        text: >-
                          Certainly! I'd be happy to help you find a blue coat.
                          I'll use the product recommendation tool to search for
                          that.
                      - type: TOOL_USE_REQUEST
                        toolInput:
                          categories:
                            - coats & jackets
                          colors:
                            - blue
                          keywords:
                            - coat
                          price_range:
                            min: 100
                            max: 200
                          limit: 5
                          today: '2023-06-10T12:00:00.000Z'
                          id: 550e8400-e29b-41d4-a716-446655440000
                        name: get_product_recommendations
                        toolCallId: toolu_bdrk_01Tnc9RttRWSwvKHd5JA1sRk
                    modelId: domo.domo_ai.domogpt-medium-v1.2:anthropic
                    isCustomerModel: false
                    sessionId: 526bb9ee-02d0-4717-a83d-946715b5fa82
                    requestId: c765dc33-9f3e-4f23-84e5-cf7aa2cd3f63
                    stopReason: TOOL_USE
                Final Answer Response:
                  description: Final Answer Response
                  value:
                    content:
                      - type: TEXT
                        text: >-
                          Great! I've found a product that matches your request.
                          The system has recommended a "Wool Blue Coat" for you.
                          Would you like more details about this coat, or would
                          you prefer to see more options?
                    modelId: domo.domo_ai.domogpt-medium-v1.2:anthropic
                    isCustomerModel: false
                    sessionId: 9c8bf9c4-ef26-4726-818d-a9f57c2a5c46
                    requestId: f0a1a239-4c2d-48f0-825b-28e657f1bb9c
                    stopReason: END_TURN
        '403':
          description: Forbidden
          content:
            '*/*':
              schema:
                type: string
        '409':
          description: Conflict
      security:
        - domo-developer-token: []
components:
  schemas:
    ToolCallRequest:
      type: object
      description: Request for making tool calls using AI.
      properties:
        input:
          type: array
          description: The list of input messages to be processed by the AI.
          items:
            $ref: '#/components/schemas/Message'
        sessionId:
          type: string
          format: uuid
          description: >-
            The unique identifier for the AI session associated with this
            request.
        system:
          type: array
          description: System-level messages or configurations to guide the AI's response.
          items:
            $ref: '#/components/schemas/TextMessageContent'
        model:
          type: string
          description: The identifier of the AI model to be used for generating a response.
        modelConfiguration:
          type: object
          additionalProperties: {}
          description: >-
            Specific parameters or settings that configure the AI model
            behavior.
        temperature:
          type: number
          format: double
          description: A parameter for controlling the randomness of the model's output.
        maxTokens:
          type: integer
          format: int32
          description: The maximum number of tokens to generate in the response.
        tools:
          type: array
          description: The list of tools the model can call.
          items:
            $ref: '#/components/schemas/FunctionBlueprint'
        toolChoice:
          $ref: '#/components/schemas/ToolChoice'
          description: How the model should use the provided tools.
        validateSchema:
          type: boolean
          description: >-
            A flag to determine whether to validate the AI response against the
            provided schema.
        reasoningConfig:
          $ref: '#/components/schemas/ReasoningConfig'
          description: Configuration for reasoning behavior and effort level.
    MessagesAIResponse:
      type: object
      description: Response from a Messages API.
      properties:
        content:
          type: array
          description: The list of content generated by the model.
          items:
            oneOf:
              - $ref: '#/components/schemas/TextMessageContent'
              - $ref: '#/components/schemas/ImageMessageContent'
              - $ref: '#/components/schemas/DocumentMessageContent'
              - $ref: '#/components/schemas/ToolUseRequestMessageContent'
              - $ref: '#/components/schemas/ReasoningMessageContent'
        modelId:
          type: string
          description: The id of the model used to generate the response.
        sessionId:
          type: string
          format: uuid
          description: The id of the AI Session associated with this request.
        stopReason:
          type: string
          description: The reason that the model stopped.
          enum:
            - TOOL_USE
            - MAX_TOKENS
            - STOP_SEQUENCE
            - END_TURN
            - CONTENT_FILTERED
            - SAFETY
            - UNKNOWN
        modelProviderUsage:
          $ref: '#/components/schemas/ModelProviderUsage'
          description: The token usage from the model provider.
    Message:
      type: object
      description: An individual message in a Messages API request or response.
      properties:
        content:
          type: array
          description: the list of content items that make up this message
          items:
            oneOf:
              - $ref: '#/components/schemas/DocumentMessageContent'
              - $ref: '#/components/schemas/ImageMessageContent'
              - $ref: '#/components/schemas/ReasoningMessageContent'
              - $ref: '#/components/schemas/TextMessageContent'
              - $ref: '#/components/schemas/ToolUseRequestMessageContent'
              - $ref: '#/components/schemas/ToolUseResultMessageContent'
        role:
          type: string
          description: the role of the message sender
          enum:
            - USER
            - ASSISTANT
      required:
        - content
    TextMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            text:
              type: string
              description: the text content of the message
      description: Text-based message content.
    FunctionBlueprint:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        parameters:
          $ref: '#/components/schemas/ObjectFunctionParameter'
    ToolChoice:
      type: object
      properties:
        type:
          type: string
          enum:
            - AUTO
            - ANY
            - TOOL
            - UNKNOWN
        name:
          type: string
        allowParallelToolCalls:
          type: boolean
    ReasoningConfig:
      type: object
      properties:
        reasoningEffort:
          type: string
          enum:
            - NONE
            - LOW
            - MEDIUM
            - HIGH
    ImageMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            image:
              $ref: '#/components/schemas/Image'
              description: the image data and metadata
      description: Image-based message content.
    DocumentMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            document:
              $ref: '#/components/schemas/Document'
              description: the document data and metadata
      description: Document-based message content.
    ToolUseRequestMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            toolInput:
              type: object
              additionalProperties: {}
              description: the input parameters for the tool
            name:
              type: string
              description: the name of the tool to execute
            toolCallId:
              type: string
              description: unique identifier for this tool call
      description: Tool use request message content.
      required:
        - name
        - toolCallId
        - toolInput
    ReasoningMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            text:
              type: string
              description: the reasoning/thinking text generated by the model
            signature:
              type: string
              description: optional signature for the reasoning content
      description: |-
        Reasoning (thinking) message content.
         Contains the model's internal reasoning process when extended thinking is enabled.
    ModelProviderUsage:
      type: object
      properties:
        inputTokens:
          type: integer
          format: int64
        outputTokens:
          type: integer
          format: int64
        totalTokens:
          type: integer
          format: int64
        reasoningTokens:
          type: integer
          format: int64
    ToolUseResultMessageContent:
      allOf:
        - $ref: '#/components/schemas/MessageContent'
        - type: object
          properties:
            toolCallId:
              type: string
              description: unique identifier for the tool call this result corresponds to
            content:
              type: array
              description: the result content from the tool execution
              items:
                description: The result content from the tool execution
                oneOf:
                  - $ref: '#/components/schemas/TextMessageContent'
        - type: object
          properties:
            toolCallId:
              type: string
              description: unique identifier for the tool call this result corresponds to
            content:
              type: array
              description: the result content from the tool execution
              items:
                description: The result content from the tool execution
                oneOf:
                  - $ref: '#/components/schemas/DocumentMessageContent'
                  - $ref: '#/components/schemas/ImageMessageContent'
                  - $ref: '#/components/schemas/ReasoningMessageContent'
                  - $ref: '#/components/schemas/TextMessageContent'
                  - $ref: '#/components/schemas/ToolUseRequestMessageContent'
                  - $ref: '#/components/schemas/ToolUseResultMessageContent'
                  - $ref: '#/components/schemas/TextMessageContent'
      description: Tool use result message content.
      required:
        - toolCallId
    MessageContent:
      description: Base interface for multi-modal message content
      discriminator:
        propertyName: type
      properties:
        type:
          type: string
      required:
        - type
    ObjectFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            additionalProperties:
              type: boolean
            required:
              type: array
              items:
                type: string
            enum:
              type: array
              items:
                type: object
                additionalProperties: {}
              uniqueItems: true
            properties:
              type: object
              additionalProperties:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
            minProperties:
              type: integer
              format: int32
            maxProperties:
              type: integer
              format: int32
            const:
              type: object
              additionalProperties: {}
      required:
        - properties
        - type
    Image:
      type: object
      description: Image data and metadata.
      properties:
        data:
          type: string
          description: the base64 encoded image data
        type:
          type: string
          description: the image type e.g. "base64"
        mediaType:
          type: string
          description: the media type of the image e.g. "image/png"
    Document:
      type: object
      description: Document data and metadata.
      properties:
        data:
          type: string
          description: the base64-encoded document data
        type:
          type: string
          description: the document type e.g. "base64"
        mediaType:
          type: string
          description: the media type of the document e.g. "application/pdf"
        name:
          type: string
          description: the name of the document
    FunctionParameterObject:
      type: object
      properties:
        type:
          type: string
          enum:
            - object
            - array
            - string
            - number
            - integer
            - boolean
            - 'null'
            - unknown
            - oneOf
            - allOf
            - anyOf
        const: {}
        enum:
          type: array
          items: {}
          uniqueItems: true
      required:
        - type
    ArrayFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            items:
              oneOf:
                - $ref: '#/components/schemas/ArrayFunctionParameter'
                - $ref: '#/components/schemas/BooleanFunctionParameter'
                - $ref: '#/components/schemas/IntegerFunctionParameter'
                - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                - $ref: '#/components/schemas/NullFunctionParameter'
                - $ref: '#/components/schemas/NumberFunctionParameter'
                - $ref: '#/components/schemas/ObjectFunctionParameter'
                - $ref: '#/components/schemas/StringFunctionParameter'
            enum:
              type: array
              items:
                type: array
                items: {}
              uniqueItems: true
            minItems:
              type: integer
              format: int32
            maxItems:
              type: integer
              format: int32
            uniqueItems:
              type: boolean
            const:
              type: array
              items: {}
      required:
        - description
        - type
    BooleanFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            const:
              type: boolean
            enum:
              type: array
              items:
                type: boolean
              uniqueItems: true
      required:
        - description
        - type
    IntegerFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            multipleOf:
              type: integer
              format: int32
            minimum:
              type: integer
              format: int32
            exclusiveMinimum:
              type: integer
              format: int32
            maximum:
              type: integer
              format: int32
            exclusiveMaximum:
              type: integer
              format: int32
            enum:
              type: array
              items:
                type: integer
                format: int32
              uniqueItems: true
            const:
              type: integer
              format: int32
      required:
        - description
        - type
    LogicalOperatorFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            oneOf:
              type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
            allOf:
              type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
            anyOf:
              type: array
              items:
                oneOf:
                  - $ref: '#/components/schemas/ArrayFunctionParameter'
                  - $ref: '#/components/schemas/BooleanFunctionParameter'
                  - $ref: '#/components/schemas/IntegerFunctionParameter'
                  - $ref: '#/components/schemas/LogicalOperatorFunctionParameter'
                  - $ref: '#/components/schemas/NullFunctionParameter'
                  - $ref: '#/components/schemas/NumberFunctionParameter'
                  - $ref: '#/components/schemas/ObjectFunctionParameter'
                  - $ref: '#/components/schemas/StringFunctionParameter'
      required:
        - description
        - type
    NullFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
      required:
        - description
        - type
    NumberFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            multipleOf:
              type: number
              format: double
            minimum:
              type: number
              format: double
            exclusiveMinimum:
              type: number
              format: double
            maximum:
              type: number
              format: double
            exclusiveMaximum:
              type: number
              format: double
            enum:
              type: array
              items:
                type: number
                format: double
              uniqueItems: true
            const:
              type: number
              format: double
      required:
        - description
        - type
    StringFunctionParameter:
      allOf:
        - $ref: '#/components/schemas/FunctionParameterObject'
        - type: object
          properties:
            description:
              type: string
            title:
              type: string
            minLength:
              type: integer
              format: int32
            maxLength:
              type: integer
              format: int32
            pattern:
              type: string
            enum:
              type: array
              items:
                type: string
              uniqueItems: true
            format:
              type: string
            const:
              type: string
      required:
        - description
        - type
  securitySchemes:
    domo-developer-token:
      type: apiKey
      name: X-DOMO-Developer-Token
      in: header

````