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

# Run Task

> Run a configured task and return the generated object as { output }.

With `?stream=true`, returns the raw partial JSON text stream expected by
AI SDK v5 `useObject`. The streamed JSON is the task output itself.

**Required ACL:** `search`


## OpenAPI

````yaml specs/agent-studio.yml post /1/agents/{agentId}/tasks
openapi: 3.1.0
info:
  title: Agent Studio API
  description: >
    The Agent Studio API lets you build and operate generative AI agents that
    use Algolia data, tools, and your chosen LLM provider.


    Use it to create, configure, publish, and update agents, then generate chat
    completions grounded in live data from your Algolia indices. You can manage
    LLM providers, Agent Studio tools, conversations, feedback, secret keys,
    user data, caching, and application settings for your AI experiences.


    ## Client libraries


    Use Algolia's API clients and libraries to reliably integrate Algolia's APIs
    with your apps.

    The official API clients are covered by Algolia's [Service Level
    Agreement](https://www.algolia.com/policies/sla).


    For more information, see [Algolia's
    ecosystem](https://www.algolia.com/doc/libraries).


    ## Base URLs


    Base URLs for the Agent Studio API:


    - `https://{APPLICATION_ID}.algolia.net`

    - `https://{APPLICATION_ID}-dsn.algolia.net`.
      If your subscription includes a [Distributed Search Network](https://dashboard.algolia.com/infra),
      this ensures that requests are sent to servers closest to users.

    Both URLs provide high availability by distributing requests with load
    balancing.


    All Agent Studio paths are prefixed with `/agent-studio`.


    **All requests must use HTTPS.**


    ## Retry strategy


    To guarantee high availability, implement a retry strategy for all API
    requests using the URLs of your servers as fallbacks:


    - `https://{APPLICATION_ID}-1.algolianet.com`

    - `https://{APPLICATION_ID}-2.algolianet.com`

    - `https://{APPLICATION_ID}-3.algolianet.com`


    These URLs use a different DNS provider than the primary URLs.

    Randomize this list to ensure an even load across the three servers.


    All Algolia API clients implement this retry strategy.


    ## Authentication


    Add these headers to authenticate requests:


    - `x-algolia-application-id`. Your Algolia application ID.

    - `x-algolia-api-key`. An API key with the necessary permissions to make the
    request.
      The required access control list (ACL) to make a request is listed in each endpoint's reference.

    You can find your application ID and API key in the [Algolia
    dashboard](https://dashboard.algolia.com/account/api-keys).


    ## Rate limits


    The Agent Studio API rate-limits requests.

    Responses include `X-RateLimit-Limit` and `X-RateLimit-Remaining` headers
    with the current limit.

    When you exceed the limit, the API returns a `429` status with a
    `Retry-After` header.


    ## Request format


    Request bodies must be JSON objects.


    ## Parameters


    Parameters are passed as query parameters for GET and DELETE requests,

    and in the request body for POST and PUT requests.


    Query parameters must be
    [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding).

    Non-ASCII characters must be UTF-8 encoded.

    Plus characters (`+`) are interpreted as spaces.


    ## Response status and errors


    The Agent Studio API returns JSON responses. Since JSON doesn't guarantee
    any specific ordering, don't rely on the order of attributes in the API
    response.


    Successful responses return `2xx` statuses. Client errors return `4xx`
    statuses. Server errors return `5xx` statuses.

    Error responses have a `message` property with more information.


    ## Version


    The current version of the Agent Studio API is version 1, indicated by the
    `/1/` in each endpoint's URL.
  version: 1.0.0
servers:
  - url: https://{APPLICATION_ID}.algolia.net/agent-studio
    description: Agent Studio API.
    variables:
      APPLICATION_ID:
        default: EXAMPLE
        description: Your Algolia application ID.
security:
  - appId: []
    apiKey: []
tags:
  - name: Agents
    description: Manage your agents.
  - name: Allowed Domains
    description: Restrict where an agent's API key may be used.
  - name: Completions
    description: Generate completions.
  - name: Configurations
    description: Manage Agent Studio related application configurations.
  - name: Context
    description: Compact or trim conversation context before sending it to completions.
  - name: Conversations
    description: View, export, and delete conversation history.
  - name: Feedback
    description: Capture user feedback on agent responses.
  - name: Providers
    description: Manage your LLM providers.
  - name: Secret Keys
    description: Manage secret keys used to authenticate requests.
  - name: Tasks
    description: Run configured agent tasks.
  - name: User Data
    description: Manage end-user data associated with conversations.
paths:
  /1/agents/{agentId}/tasks:
    post:
      tags:
        - Tasks
      summary: Run Task
      description: >-
        Run a configured task and return the generated object as ``{ output }``.


        With ``?stream=true``, returns the raw partial JSON text stream expected
        by

        AI SDK v5 ``useObject``. The streamed JSON is the task output itself.
      operationId: createAgentTask
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/AgentIdUnion'
          description: The agentId.
        - name: analytics
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Set to false to skip endpoint-specific analytics for this task
              call (default: true). Disables the task analytics event;
              operational metrics and traces are always emitted.
            default: true
            title: analytics
          description: >-
            Set to false to skip endpoint-specific analytics for this task call
            (default: true). Disables the task analytics event; operational
            metrics and traces are always emitted.
        - name: cache
          in: query
          required: false
          schema:
            type: boolean
            description: Use cached responses if available.
            default: true
            title: cache
          description: Use cached responses if available.
        - name: stream
          in: query
          required: false
          schema:
            type: boolean
            description: Whether to stream the response or not.
            default: false
            title: stream
          description: Whether to stream the response or not.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskRequest'
      responses:
        '200':
          description: Successful Response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '422':
          description: Validation Error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: csharp
          label: C#
          source: |-
            // Initialize the client
            var client = new AgentStudioClient(
              new AgentStudioConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
            );

            // Call the API
            var response = await client.CreateAgentTaskAsync(
              "76710f1b-8231-42e5-b0d1-f43aac618e15",
              new TaskRequest
              {
                Input = new Dictionary<string, object>
                {
                  { "pageType", "pdp" },
                  { "title", "acmePhone128Gb" },
                },
              }
            );

            // print the response
            Console.WriteLine(response);
        - lang: dart
          label: Dart
          source: |-
            // Initialize the client
            final client = AgentStudioClient(
                appId: 'ALGOLIA_APPLICATION_ID', apiKey: 'ALGOLIA_API_KEY');

            // Call the API
            final response = await client.createAgentTask(
              agentId: "76710f1b-8231-42e5-b0d1-f43aac618e15",
              taskRequest: TaskRequest(
                input: {
                  'pageType': "pdp",
                  'title': "acmePhone128Gb",
                },
              ),
            );

            // print the response
            print(response);
        - lang: go
          label: Go
          source: >-
            // Initialize the client

            client, err := agentStudio.NewClient("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY")

            if err != nil {
              // The client can fail to initialize if you pass an invalid parameter.
              panic(err)
            }


            // Use the streaming variant to iterate over events

            stream, err :=
            client.CreateAgentTaskStream(client.NewApiCreateAgentTaskRequest(
              "76710f1b-8231-42e5-b0d1-f43aac618e15",
              agentStudio.NewEmptyTaskRequest().SetInput(map[string]any{"pageType": "pdp", "title": "acmePhone128Gb"})))
            if err != nil {
              // handle the eventual error
              panic(err)
            }


            defer func() { _ = stream.Close() }()


            for stream.Next() {
              event := stream.Current()
              if event.Err != nil {
                // handle the eventual per-event deserialization error
                continue
              }

              
              fmt.Println(*event.Data)
            }


            err = stream.Err()

            if err != nil {
              // handle the eventual error
              panic(err)
            }
        - lang: java
          label: Java
          source: >-
            // Initialize the client

            AgentStudioClient client = new
            AgentStudioClient("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY");


            // Call the API

            TaskResponse response = client.createAgentTask(
              "76710f1b-8231-42e5-b0d1-f43aac618e15",
              new TaskRequest().setInput(
                new HashMap() {
                  {
                    put("pageType", "pdp");
                    put("title", "acmePhone128Gb");
                  }
                }
              )
            );


            // print the response

            System.out.println(response);
        - lang: javascript
          label: JavaScript
          source: >-
            // Initialize the client

            const client = agentStudioClient('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY');


            // Use the streaming variant to iterate over events

            for await (const event of client.createAgentTaskStream({
              agentId: '76710f1b-8231-42e5-b0d1-f43aac618e15',
              taskRequest: { input: { pageType: 'pdp', title: 'acmePhone128Gb' } },
            })) {
              console.log(event.data);
            }
        - lang: kotlin
          label: Kotlin
          source: >-
            // Initialize the client

            val client = AgentStudioClient(appId = "ALGOLIA_APPLICATION_ID",
            apiKey = "ALGOLIA_API_KEY")


            // Call the API

            var response =
              client.createAgentTask(
                agentId = "76710f1b-8231-42e5-b0d1-f43aac618e15",
                taskRequest =
                  TaskRequest(
                    input =
                      buildJsonObject {
                        put("pageType", JsonPrimitive("pdp"))
                        put("title", JsonPrimitive("acmePhone128Gb"))
                      }
                  ),
              )


            // print the response

            println(response)
        - lang: php
          label: PHP
          source: >-
            // Initialize the client

            $client = AgentStudioClient::create('ALGOLIA_APPLICATION_ID',
            'ALGOLIA_API_KEY');


            // Call the API

            $response = $client->createAgentTask(
                '76710f1b-8231-42e5-b0d1-f43aac618e15',
                ['input' => ['pageType' => 'pdp',
                    'title' => 'acmePhone128Gb',
                ],
                ],
            );



            // print the response

            var_dump($response);
        - lang: python
          label: Python
          source: >-
            # Initialize the client

            # In an asynchronous context, you can use AgentStudioClient instead,
            which exposes the exact same methods.

            client = AgentStudioClientSync("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY")


            # Use the streaming variant to iterate over events

            for event in client.create_agent_task_stream(
                agent_id="76710f1b-8231-42e5-b0d1-f43aac618e15",
                task_request={
                    "input": {
                        "pageType": "pdp",
                        "title": "acmePhone128Gb",
                    },
                },
            ):
                
                print(event.data)
        - lang: ruby
          label: Ruby
          source: >-
            # Initialize the client

            client = Algolia::AgentStudioClient.create("ALGOLIA_APPLICATION_ID",
            "ALGOLIA_API_KEY")


            # Call the API

            response = client.create_agent_task(
              "76710f1b-8231-42e5-b0d1-f43aac618e15",
              Algolia::AgentStudio::TaskRequest.new(input: {pageType: "pdp", title: "acmePhone128Gb"})
            )



            # print the response

            puts(response)
        - lang: scala
          label: Scala
          source: >-
            // Initialize the client

            val client = AgentStudioClient(appId = "ALGOLIA_APPLICATION_ID",
            apiKey = "ALGOLIA_API_KEY")


            // Call the API

            val response = Await.result(
              client.createAgentTask(
                agentId = "76710f1b-8231-42e5-b0d1-f43aac618e15",
                taskRequest = TaskRequest(
                  input = Map("pageType" -> "pdp", "title" -> "acmePhone128Gb")
                )
              ),
              Duration(100, "sec")
            )


            // print the response

            println(response)
        - lang: swift
          label: Swift
          source: >-
            // Initialize the client

            let client = try AgentStudioClient(appID: "ALGOLIA_APPLICATION_ID",
            apiKey: "ALGOLIA_API_KEY")


            // Call the API

            let response = try await client.createAgentTask(
                agentId: "76710f1b-8231-42e5-b0d1-f43aac618e15",
                taskRequest: TaskRequest(input: ["pageType": AnyCodable("pdp"), "title": AnyCodable("acmePhone128Gb")])
            )


            // print the response

            print(response)
        - lang: cURL
          label: curl
          source: |-
            curl --request POST \
              --url 'https://example.algolia.net/agent-studio/1/agents/lorem/tasks?stream=false&cache=true&analytics=true' \
              --header 'accept: application/json' \
              --header 'content-type: application/json' \
              --header 'x-algolia-api-key: ALGOLIA_API_KEY' \
              --header 'x-algolia-application-id: ALGOLIA_APPLICATION_ID' \
              --data '
            {
              "task": "algolia_on_page_suggestions",
              "kind": "prompt_suggestions",
              "input": {},
              "configuration": {
                "id": null,
                "providerId": null,
                "model": null,
                "instructions": "lorem",
                "systemPrompt": null,
                "config": {},
                "tools": [
                  {
                    "name": "lorem",
                    "type": "client_side",
                    "description": "lorem",
                    "inputSchema": {
                      "type": "object",
                      "properties": {},
                      "required": [
                        "lorem"
                      ]
                    },
                    "isTerminal": false
                  }
                ]
              }
            }
            '
components:
  schemas:
    AgentIdUnion:
      oneOf:
        - type: string
        - const: test
          type: string
    TaskRequest:
      properties:
        input:
          additionalProperties: true
          type: object
          title: input
          description: Arbitrary JSON input passed to the task as data.
        configuration:
          $ref: '#/components/schemas/AgentTestConfiguration'
        kind:
          $ref: '#/components/schemas/TaskKind'
        task:
          type: string
          maxLength: 64
          minLength: 3
          title: task
          description: ID of the configured task to run.
          examples:
            - algolia_on_page_suggestions
      additionalProperties: false
      type: object
      required:
        - input
      title: taskRequest
      description: |-
        Strict request body with a task selector and `input`.

        Unknown top-level fields are rejected so clients cannot pass trusted
        configuration fields (prompts, schemas, providers, models, generation
        settings) at runtime.
    TaskResponse:
      properties:
        output:
          additionalProperties: true
          type: object
          title: output
      type: object
      required:
        - output
      title: taskResponse
      description: Response body for a completed task run.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: detail
      type: object
      title: hTTPValidationError
    AgentTestConfiguration:
      description: Dynamic configuration for testing agents.
      properties:
        config:
          additionalProperties: true
          type: object
          title: config
        instructions:
          type: string
          title: instructions
        tools:
          items:
            $ref: '#/components/schemas/ItemsUnion'
          title: tools
          type: array
        id:
          type: string
          default: null
          title: id
        model:
          type: string
          default: null
          title: model
        providerId:
          type: string
          default: null
          title: providerid
        systemPrompt:
          type: string
          default: null
          title: systemprompt
      required:
        - instructions
        - config
        - tools
      title: agentTestConfiguration
      type: object
    TaskKind:
      type: string
      enum:
        - prompt_suggestions
      title: taskKind
      description: Supported task behaviors used for default task resolution.
    ValidationError:
      properties:
        loc:
          items:
            $ref: '#/components/schemas/LocationItemUnion'
          type: array
          title: location
        msg:
          type: string
          title: message
        type:
          type: string
          title: errorType
      type: object
      required:
        - loc
        - msg
        - type
      title: validationError
    ItemsUnion:
      oneOf:
        - $ref: '#/components/schemas/ClientSideToolConfig'
        - $ref: '#/components/schemas/AlgoliaSearchToolConfig'
        - $ref: '#/components/schemas/AlgoliaRecommendToolConfig'
        - $ref: '#/components/schemas/AlgoliaGroupedResultsToolConfig'
        - $ref: '#/components/schemas/AlgoliaGroupedResultsCompatToolConfig'
        - $ref: '#/components/schemas/McpServerToolConfig'
        - $ref: '#/components/schemas/UnknownToolConfig'
      discriminator:
        mapping:
          algolia_display_results: '#/components/schemas/AlgoliaGroupedResultsCompatToolConfig'
          algolia_grouped_results: '#/components/schemas/AlgoliaGroupedResultsToolConfig'
          algolia_recommend: '#/components/schemas/AlgoliaRecommendToolConfig'
          algolia_search_index: '#/components/schemas/AlgoliaSearchToolConfig'
          client_side: '#/components/schemas/ClientSideToolConfig'
          mcp_tools: '#/components/schemas/McpServerToolConfig'
          unknown: '#/components/schemas/UnknownToolConfig'
        propertyName: type
    LocationItemUnion:
      oneOf:
        - type: string
        - type: integer
    ClientSideToolConfig:
      properties:
        description:
          maxLength: 200
          minLength: 1
          title: description
          type: string
        inputSchema:
          $ref: '#/components/schemas/ClientToolsArgsSchema'
        name:
          maxLength: 32
          minLength: 3
          title: name
          type: string
        type:
          const: client_side
          default: client_side
          title: type
          type: string
        isTerminal:
          default: false
          description: >-
            Server-side declaration that this tool is display/render-only: a
            resolved result ends the turn and the model is not re-invoked on it
            (CR-11753). The client's terminal claim on a tool result is honored
            only when this agrees; leave false for data tools whose result the
            model must reason about.
          title: isterminal
          type: boolean
      required:
        - type
        - name
        - description
        - inputSchema
      title: clientSideToolConfig
      type: object
    AlgoliaSearchToolConfig:
      properties:
        indices:
          items:
            $ref: '#/components/schemas/AlgoliaSearchToolIndexConfig'
          title: indices
          type: array
        name:
          maxLength: 32
          minLength: 3
          title: name
          type: string
        type:
          const: algolia_search_index
          default: algolia_search_index
          title: type
          type: string
        allowUnlistedIndices:
          default: false
          title: allowunlistedindices
          type: boolean
        mode:
          $ref: '#/components/schemas/ModeEnum'
      required:
        - type
        - name
        - indices
      title: algoliaSearchToolConfig
      type: object
    AlgoliaRecommendToolConfig:
      description: |-
        Configuration for the Algolia Recommend tool.
        Allows specifying recommend models and related parameters.
      properties:
        name:
          maxLength: 32
          minLength: 3
          title: name
          type: string
        type:
          const: algolia_recommend
          default: algolia_recommend
          title: type
          type: string
        allowedConfigs:
          default: []
          items:
            $ref: '#/components/schemas/AlgoliaRecommendToolIndexConfig'
          title: allowedconfigs
          type: array
        predefinedRecommendParameters:
          additionalProperties: true
          title: predefinedrecommendparameters
          type: object
      required:
        - type
        - name
      title: algoliaRecommendToolConfig
      type: object
    AlgoliaGroupedResultsToolConfig:
      description: Configuration for the algolia_grouped_results tool.
      properties:
        type:
          const: algolia_grouped_results
          default: algolia_grouped_results
          title: type
          type: string
        isTerminal:
          default: false
          description: >-
            When true, a successful tool invocation ends the agent graph (no
            further LLM turn). Use for chat experiences where the tool payload
            IS the final response. Leave false to let the main LLM produce a
            concluding assistant message after the tool runs.
          title: isterminal
          type: boolean
        maxGroups:
          default: 3
          description: Maximum number of result groups.
          maximum: 6
          minimum: 1
          title: maxgroups
          type: integer
        maxResultsPerGroup:
          default: 6
          description: Maximum hits per group.
          maximum: 15
          minimum: 1
          title: maxresultspergroup
          type: integer
        minGroups:
          default: 1
          description: Minimum number of result groups.
          maximum: 6
          minimum: 1
          title: mingroups
          type: integer
        minResultsPerGroup:
          default: 3
          description: Minimum hits per group.
          maximum: 15
          minimum: 1
          title: minresultspergroup
          type: integer
        name:
          const: algolia_grouped_results
          default: algolia_grouped_results
          title: name
          type: string
      title: algoliaGroupedResultsToolConfig
      type: object
      required:
        - type
    AlgoliaGroupedResultsCompatToolConfig:
      deprecated: true
      description: Use `algolia_grouped_results`.
      properties:
        type:
          const: algolia_display_results
          default: algolia_display_results
          title: type
          type: string
        isTerminal:
          default: false
          description: >-
            When true, a successful tool invocation ends the agent graph (no
            further LLM turn). Use for chat experiences where the tool payload
            IS the final response. Leave false to let the main LLM produce a
            concluding assistant message after the tool runs.
          title: isterminal
          type: boolean
        maxGroups:
          default: 3
          description: Maximum number of result groups.
          maximum: 6
          minimum: 1
          title: maxgroups
          type: integer
        maxResultsPerGroup:
          default: 6
          description: Maximum hits per group.
          maximum: 15
          minimum: 1
          title: maxresultspergroup
          type: integer
        minGroups:
          default: 1
          description: Minimum number of result groups.
          maximum: 6
          minimum: 1
          title: mingroups
          type: integer
        minResultsPerGroup:
          default: 3
          description: Minimum hits per group.
          maximum: 15
          minimum: 1
          title: minresultspergroup
          type: integer
        name:
          const: algolia_display_results
          default: algolia_display_results
          title: name
          type: string
      title: algoliaGroupedResultsCompatToolConfig
      type: object
      required:
        - type
    McpServerToolConfig:
      properties:
        headers:
          additionalProperties:
            type: string
          title: headers
          type: object
        name:
          maxLength: 32
          minLength: 3
          title: name
          type: string
        type:
          const: mcp_tools
          default: mcp_tools
          title: type
          type: string
        url:
          maxLength: 512
          minLength: 1
          title: url
          type: string
        allowedTools:
          $ref: '#/components/schemas/AllowedToolsUnion'
        id:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          description: Stable unique identifier for this MCP tool.
          title: id
        transport:
          const: streamable_http
          default: streamable_http
          title: transport
          type: string
      required:
        - type
        - url
        - headers
        - name
      title: mcpServerToolConfig
      type: object
    UnknownToolConfig:
      additionalProperties: true
      description: A tool configuration that this version of the API does not recognize.
      properties:
        name:
          maxLength: 32
          minLength: 3
          title: name
          type: string
        type:
          const: unknown
          default: unknown
          title: type
          type: string
      required:
        - type
        - name
      title: unknownToolConfig
      type: object
    ClientToolsArgsSchema:
      properties:
        properties:
          type: object
          additionalProperties: true
          title: properties
        required:
          items:
            type: string
          title: required
          type: array
        type:
          const: object
          default: object
          title: type
          type: string
      title: clientToolsArgsSchema
      type: object
    AlgoliaSearchToolIndexConfig:
      properties:
        description:
          maxLength: 3000
          minLength: 1
          title: description
          type: string
        index:
          maxLength: 100
          minLength: 1
          title: index
          type: string
        enhancedDescription:
          default: ''
          title: enhanceddescription
          type: string
        searchControls:
          oneOf:
            - $ref: '#/components/schemas/IndexSearchParameters'
            - type: 'null'
        searchParameters:
          oneOf:
            - $ref: '#/components/schemas/SearchParameters'
            - type: 'null'
      required:
        - index
        - description
      title: algoliaSearchToolIndexConfig
      type: object
    ModeEnum:
      type: string
      enum:
        - static
        - dynamic
    AlgoliaRecommendToolIndexConfig:
      properties:
        index:
          maxLength: 100
          minLength: 1
          title: index
          type: string
        modelName:
          maxLength: 100
          minLength: 1
          title: modelname
          type: string
        description:
          default: ''
          title: description
          type: string
      required:
        - index
        - modelName
      title: algoliaRecommendToolIndexConfig
      type: object
    AllowedToolsUnion:
      oneOf:
        - additionalProperties:
            $ref: '#/components/schemas/ToolConfigOrBooleanUnion'
          type: object
        - type: 'null'
    IndexSearchParameters:
      description: >-
        Structured search parameters configuration for an Algolia index.


        Each parameter controls whether it is exposed to the LLM, its default
        value,

        optional constraints, and merge behavior.
      properties:
        attributesToRetrieve:
          $ref: '#/components/schemas/StringArrayParam'
        custom:
          oneOf:
            - type: object
              additionalProperties: true
            - type: 'null'
          default: null
          title: custom
        distinct:
          oneOf:
            - $ref: '#/components/schemas/BooleanParam'
            - type: 'null'
        facets:
          oneOf:
            - $ref: '#/components/schemas/FacetsParam'
            - type: 'null'
        hitsPerPage:
          $ref: '#/components/schemas/NumberParam'
        page:
          $ref: '#/components/schemas/NumberParam'
        query:
          oneOf:
            - $ref: '#/components/schemas/TextParam'
            - type: 'null'
        responseFields:
          $ref: '#/components/schemas/StringArrayParam'
      title: indexSearchParameters
      type: object
    SearchParameters:
      description: >-
        Algolia Search API parameters that can be predefined for the search
        tool.

        Reference:
        https://www.algolia.com/doc/api-reference/search-api-parameters/


        The search tool supports the relevant subset of search parameters in the
        context of agentic interactions.
      properties:
        advancedSyntax:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: advancedsyntax
        advancedSyntaxFeatures:
          $ref: '#/components/schemas/AdvancedSyntaxFeaturesUnion'
        allowTyposOnNumericTokens:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: allowtyposonnumerictokens
        alternativesAsExact:
          $ref: '#/components/schemas/AlternativesAsExactUnion'
        analytics:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: analytics
        analyticsTags:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: analyticstags
        aroundLatLng:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          title: aroundlatlng
        aroundLatLngViaIp:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: aroundlatlngviaip
        aroundPrecision:
          $ref: '#/components/schemas/AroundPrecisionUnion'
        aroundRadius:
          $ref: '#/components/schemas/AroundRadiusUnion'
        attributeCriteriaComputedByMinProximity:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: attributecriteriacomputedbyminproximity
        attributesToRetrieve:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: attributestoretrieve
        attributesToSnippet:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: attributestosnippet
        clickAnalytics:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: clickanalytics
        decompoundQuery:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: decompoundquery
        disableExactOnAttributes:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: disableexactonattributes
        disableTypoToleranceOnAttributes:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: disabletypotoleranceonattributes
        distinct:
          $ref: '#/components/schemas/DistinctUnion'
        enableAbTest:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: enableabtest
        enablePersonalization:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: enablepersonalization
        enableReRanking:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: enablereranking
        enableRules:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: enablerules
        exactOnSingleWordQuery:
          oneOf:
            - $ref: '#/components/schemas/ExactOnSingleWordQuery'
            - type: 'null'
        explain:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: explain
        facetFilters:
          oneOf:
            - $ref: '#/components/schemas/FacetFiltersUnion'
            - type: 'null'
        facetingAfterDistinct:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: facetingafterdistinct
        facets:
          $ref: '#/components/schemas/FacetsUnion'
        filters:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          title: filters
        getRankingInfo:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: getrankinginfo
        hitsPerPage:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: hitsperpage
        ignorePlurals:
          $ref: '#/components/schemas/IgnorePluralsUnion'
        insideBoundingBox:
          $ref: '#/components/schemas/InsideBoundingBoxUnion'
        insidePolygon:
          $ref: '#/components/schemas/InsidePolygonUnion'
        length:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: length
        maxFacetHits:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: maxfacethits
        maxValuesPerFacet:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: maxvaluesperfacet
        minimumAroundRadius:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: minimumaroundradius
        minProximity:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: minproximity
        minWordSizeFor1Typo:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: minwordsizefor1Typo
        minWordSizeFor2Typos:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: minwordsizefor2Typos
        naturalLanguages:
          $ref: '#/components/schemas/NaturalLanguagesUnion'
        numericFilters:
          $ref: '#/components/schemas/NumericFiltersUnion'
        offset:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: offset
        optionalFilters:
          $ref: '#/components/schemas/OptionalFiltersUnion'
        optionalWords:
          $ref: '#/components/schemas/OptionalWordsUnion'
        page:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: page
        percentileComputation:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: percentilecomputation
        personalizationImpact:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: personalizationimpact
        queryLanguages:
          $ref: '#/components/schemas/QueryLanguagesUnion'
        queryType:
          oneOf:
            - $ref: '#/components/schemas/QueryType'
            - type: 'null'
        relevancyStrictness:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: relevancystrictness
        removeStopWords:
          $ref: '#/components/schemas/RemoveStopWordsUnion'
        removeWordsIfNoResults:
          oneOf:
            - $ref: '#/components/schemas/RemoveWordsIfNoResults'
            - type: 'null'
        replaceSynonymsInHighlight:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: replacesynonymsinhighlight
        reRankingApplyFilter:
          $ref: '#/components/schemas/ReRankingApplyFilterUnion'
        restrictHighlightAndSnippetArrays:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: restricthighlightandsnippetarrays
        restrictSearchableAttributes:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: restrictsearchableattributes
        ruleContexts:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: rulecontexts
        similarQuery:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          title: similarquery
        snippetEllipsisText:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          title: snippetellipsistext
        sortFacetValuesBy:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          title: sortfacetvaluesby
        sumOrFiltersScores:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: sumorfiltersscores
        synonyms:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: synonyms
        tagFilters:
          $ref: '#/components/schemas/TagFiltersUnion'
        typoTolerance:
          $ref: '#/components/schemas/TypoToleranceUnion'
        userToken:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          title: usertoken
      title: searchParameters
      type: object
    ToolConfigOrBooleanUnion:
      oneOf:
        - $ref: '#/components/schemas/McpToolConfig'
        - type: boolean
    StringArrayParam:
      description: >-
        A string array search parameter with exposure control, constraints, and
        merge behavior.
      properties:
        exposed:
          title: exposed
          type: boolean
        constraint:
          oneOf:
            - $ref: '#/components/schemas/StringArrayParamConstraint'
            - type: 'null'
        default:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: default
        merge:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: merge
      required:
        - exposed
      title: stringArrayParam
      type: object
    BooleanParam:
      description: A boolean search parameter with exposure control.
      properties:
        exposed:
          title: exposed
          type: boolean
        default:
          oneOf:
            - type: boolean
            - type: 'null'
          default: null
          title: default
      required:
        - exposed
      title: booleanParam
      type: object
    FacetsParam:
      description: A facets parameter that is always hidden from the LLM.
      properties:
        default:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: default
        exposed:
          const: false
          default: false
          title: exposed
          type: boolean
      title: facetsParam
      type: object
    NumberParam:
      description: >-
        A number search parameter with exposure control and optional
        constraints.
      properties:
        exposed:
          title: exposed
          type: boolean
        constraint:
          oneOf:
            - $ref: '#/components/schemas/NumberParamConstraint'
            - type: 'null'
        default:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: default
      required:
        - exposed
      title: numberParam
      type: object
    TextParam:
      description: A text search parameter with exposure control.
      properties:
        exposed:
          title: exposed
          type: boolean
        default:
          oneOf:
            - type: string
            - type: 'null'
          default: null
          title: default
      required:
        - exposed
      title: textParam
      type: object
    AdvancedSyntaxFeaturesUnion:
      oneOf:
        - items:
            $ref: '#/components/schemas/AdvancedSyntaxFeatures'
          type: array
        - type: 'null'
    AlternativesAsExactUnion:
      oneOf:
        - items:
            $ref: '#/components/schemas/AlternativesAsExact'
          type: array
        - type: 'null'
    AroundPrecisionUnion:
      oneOf:
        - type: integer
        - items:
            additionalProperties:
              type: integer
            type: object
          type: array
        - type: 'null'
    AroundRadiusUnion:
      oneOf:
        - type: integer
        - type: string
        - type: 'null'
    DistinctUnion:
      oneOf:
        - type: boolean
        - type: integer
        - type: 'null'
    ExactOnSingleWordQuery:
      description: >-
        Determines how the [Exact ranking
        criterion](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/adjust-exact-settings/#turn-off-exact-for-some-attributes)
        is computed when the search query has only one word.  - `attribute`.  
        The Exact ranking criterion is 1 if the query word and attribute value
        are the same.   For example, a search for "road" will match the value
        "road", but not "road trip".  - `none`.   The Exact ranking criterion is
        ignored on single-word searches.  - `word`.   The Exact ranking
        criterion is 1 if the query word is found in the attribute value.   The
        query word must have at least 3 characters and must not be a stop
        word.   Only exact matches will be highlighted,   partial and prefix
        matches won't.
      enum:
        - attribute
        - none
        - word
      title: exactOnSingleWordQuery
      type: string
    FacetFiltersUnion:
      oneOf:
        - items:
            $ref: '#/components/schemas/FacetFiltersUnion'
          type: array
        - type: string
    FacetsUnion:
      oneOf:
        - items:
            type: string
          type: array
        - $ref: '#/components/schemas/Facets'
        - type: 'null'
    IgnorePluralsUnion:
      oneOf:
        - type: boolean
        - items:
            $ref: '#/components/schemas/SupportedLanguage'
          type: array
        - type: 'null'
    InsideBoundingBoxUnion:
      oneOf:
        - type: string
        - items:
            items:
              type: number
            type: array
          type: array
        - type: 'null'
    InsidePolygonUnion:
      oneOf:
        - type: string
        - items:
            items:
              type: number
            type: array
          type: array
        - type: 'null'
    NaturalLanguagesUnion:
      oneOf:
        - items:
            $ref: '#/components/schemas/SupportedLanguage'
          type: array
        - type: 'null'
    NumericFiltersUnion:
      oneOf:
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/NumericFiltersUnion'
        - type: 'null'
    OptionalFiltersUnion:
      oneOf:
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/OptionalFiltersUnion'
        - type: 'null'
    OptionalWordsUnion:
      oneOf:
        - type: string
        - items:
            type: string
          type: array
        - type: 'null'
    QueryLanguagesUnion:
      oneOf:
        - items:
            $ref: '#/components/schemas/SupportedLanguage'
          type: array
        - type: 'null'
    QueryType:
      description: >-
        Determines if and how query words are interpreted as prefixes.  By
        default, only the last query word is treated as a prefix (`prefixLast`).
        To turn off prefix search, use `prefixNone`. Avoid `prefixAll`, which
        treats all query words as prefixes. This might lead to counterintuitive
        results and makes your search slower.  For more information, see [Prefix
        searching](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching).
      enum:
        - prefixLast
        - prefixAll
        - prefixNone
      title: queryType
      type: string
    RemoveStopWordsUnion:
      oneOf:
        - type: boolean
        - items:
            $ref: '#/components/schemas/SupportedLanguage'
          type: array
        - type: 'null'
    RemoveWordsIfNoResults:
      description: >-
        Strategy for removing words from the query when it doesn't return any
        results. This helps to avoid returning empty search results.  -
        `none`.   No words are removed when a query doesn't return results.  -
        `lastWords`.   Treat the last (then second to last, then third to last)
        word as optional,   until there are results or at most 5 words have been
        removed.  - `firstWords`.   Treat the first (then second, then third)
        word as optional,   until there are results or at most 5 words have been
        removed.  - `allOptional`.   Treat all words as optional.  For more
        information, see [Remove words to improve
        results](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/empty-or-insufficient-results/in-depth/why-use-remove-words-if-no-results).
      enum:
        - none
        - lastWords
        - firstWords
        - allOptional
      title: removeWordsIfNoResults
      type: string
    ReRankingApplyFilterUnion:
      oneOf:
        - type: string
        - items:
            type: object
            additionalProperties: true
          type: array
        - type: 'null'
    TagFiltersUnion:
      oneOf:
        - type: string
        - type: array
          items:
            $ref: '#/components/schemas/TagFiltersUnion'
        - type: 'null'
    TypoToleranceUnion:
      oneOf:
        - type: boolean
        - $ref: '#/components/schemas/TypoToleranceEnum'
        - type: 'null'
    McpToolConfig:
      properties:
        alias:
          oneOf:
            - maxLength: 32
              minLength: 3
              type: string
            - type: 'null'
          default: null
          title: alias
        requiresApproval:
          oneOf:
            - type: boolean
            - type: 'null'
          default: false
          title: requiresapproval
      title: mcpToolConfig
      type: object
    StringArrayParamConstraint:
      description: Constraints for a string array parameter.
      properties:
        values:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: values
      title: stringArrayParamConstraint
      type: object
    NumberParamConstraint:
      description: Constraints for a number parameter.
      properties:
        max:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: max
        min:
          oneOf:
            - type: integer
            - type: 'null'
          default: null
          title: min
      title: numberParamConstraint
      type: object
    AdvancedSyntaxFeatures:
      description: AdvancedSyntaxFeatures.
      enum:
        - exactPhrase
        - excludeWords
      title: advancedSyntaxFeatures
      type: string
    AlternativesAsExact:
      description: AlternativesAsExact.
      enum:
        - ignorePlurals
        - singleWordSynonym
        - multiWordsSynonym
        - ignoreConjugations
      title: alternativesAsExact
      type: string
    Facets:
      additionalProperties: true
      description: Order of facet names.
      properties:
        order:
          oneOf:
            - items:
                type: string
              type: array
            - type: 'null'
          default: null
          title: order
      title: facets
      type: object
    SupportedLanguage:
      description: ISO code for a supported language.
      enum:
        - af
        - ar
        - az
        - bg
        - bn
        - ca
        - cs
        - cy
        - da
        - de
        - el
        - en
        - eo
        - es
        - et
        - eu
        - fa
        - fi
        - fo
        - fr
        - ga
        - gl
        - he
        - hi
        - hu
        - hy
        - id
        - is
        - it
        - ja
        - ka
        - kk
        - ko
        - ku
        - ky
        - lt
        - lv
        - mi
        - mn
        - mr
        - ms
        - mt
        - nb
        - nl
        - 'no'
        - ns
        - pl
        - ps
        - pt
        - pt-br
        - qu
        - ro
        - ru
        - sk
        - sq
        - sv
        - sw
        - ta
        - te
        - th
        - tl
        - tn
        - tr
        - tt
        - uk
        - ur
        - uz
        - zh
      title: supportedLanguage
      type: string
    TypoToleranceEnum:
      description: >-
        - `min`. Return matches with the lowest number of typos.   For example,
        if you have matches without typos, only include those.   But if there
        are no matches without typos (with 1 typo), include matches with 1 typo
        (2 typos). - `strict`. Return matches with the two lowest numbers of
        typos.   With `strict`, the Typo ranking criterion is applied first in
        the `ranking` setting.
      enum:
        - min
        - strict
        - 'true'
        - 'false'
      title: typoToleranceEnum
      type: string
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-algolia-application-id
      description: Your Algolia application ID.
    apiKey:
      type: apiKey
      in: header
      name: x-algolia-api-key
      description: >
        Your Algolia API key with the necessary permissions to make the request.

        Permissions are controlled through access control lists (ACL) and access
        restrictions.

        The required ACL to make a request is listed in each endpoint's
        reference.

````