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

# List tools



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/cerca/openapi.documented.yml get /fleets/{fleetId}/tools
openapi: 3.1.0
info:
  description: API-key accessible routes for Cerca agents.
  title: Cerca API
  version: 0.0.0
servers:
  - url: https://api.cerca.dev
security:
  - bearerAuth: []
paths:
  /fleets/{fleetId}/tools:
    get:
      tags:
        - Tools
      summary: List tools
      parameters:
        - schema:
            type: string
            minLength: 1
            example: fleet_abc123
          required: true
          in: path
          name: fleetId
        - schema:
            type: string
            description: Opaque pagination cursor returned by a previous request.
            example: cursor_abc123
          required: false
          description: Opaque pagination cursor returned by a previous request.
          name: cursor
          in: query
        - schema:
            type: string
            description: >-
              Maximum number of items to return. Defaults to 20 and preserves
              parseInt semantics.
            example: '20'
          required: false
          description: >-
            Maximum number of items to return. Defaults to 20 and preserves
            parseInt semantics.
          name: limit
          in: query
      responses:
        '200':
          description: Tool sources configured for the fleet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ToolSourcesPage'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not authorized for this fleet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Fleet or tool source not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Tool source conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: Content-Type must be application/json.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          description: Error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Cerca from '@cerca-dev/sdk';

            const client = new Cerca({
              apiKey: process.env['CERCA_API_KEY'], // This is the default and can be omitted
            });

            // Automatically fetches more pages as needed.
            for await (const toolSource of client.tools.list('fleet_abc123')) {
              console.log(toolSource);
            }
        - lang: Python
          source: |-
            import os
            from cerca import Cerca

            client = Cerca(
                api_key=os.environ.get("CERCA_API_KEY"),  # This is the default and can be omitted
            )
            page = client.tools.list(
                fleet_id="fleet_abc123",
            )
            page = page.sources[0]
            print(page)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/matrices/cerca-go\"\n\t\"github.com/matrices/cerca-go/option\"\n)\n\nfunc main() {\n\tclient := cercago.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.Tools.List(\n\t\tcontext.TODO(),\n\t\t\"fleet_abc123\",\n\t\tcercago.ToolListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Ruby
          source: |-
            require "cerca"

            cerca = Cerca::Client.new(api_key: "My API Key")

            page = cerca.tools.list("fleet_abc123")

            puts(page)
        - lang: CLI
          source: |-
            cerca tools list \
              --api-key 'My API Key' \
              --fleet-id fleet_abc123
components:
  schemas:
    ToolSourcesPage:
      type: object
      properties:
        cursor:
          type:
            - string
            - 'null'
        hasMore:
          type: boolean
        sources:
          type: array
          items:
            $ref: '#/components/schemas/ToolSource'
      required:
        - cursor
        - hasMore
        - sources
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine-readable error code when the API can provide one.
          example: MONTHLY_TOKEN_BUDGET_EXCEEDED
      required:
        - error
    ToolSource:
      oneOf:
        - $ref: '#/components/schemas/HttpToolSource'
        - $ref: '#/components/schemas/McpToolSource'
      discriminator:
        propertyName: type
        mapping:
          http:
            $ref: '#/components/schemas/HttpToolSource'
          mcp:
            $ref: '#/components/schemas/McpToolSource'
    HttpToolSource:
      type: object
      properties:
        approval:
          $ref: '#/components/schemas/ToolApprovalMode'
        auth:
          $ref: '#/components/schemas/ToolSourceAuth'
        createdAt:
          type: string
        enabled:
          type: boolean
        fleetId:
          type: string
        id:
          type: string
        namespace:
          type: string
        updatedAt:
          type: string
        version:
          type: number
        execution:
          $ref: '#/components/schemas/HttpToolExecutionPolicy'
        tools:
          type: array
          items:
            $ref: '#/components/schemas/HttpToolDefinition'
        type:
          type: string
          enum:
            - http
          x-stainless-const: true
      required:
        - auth
        - createdAt
        - enabled
        - fleetId
        - id
        - namespace
        - updatedAt
        - version
        - tools
        - type
    McpToolSource:
      type: object
      properties:
        approval:
          $ref: '#/components/schemas/ToolApprovalMode'
        auth:
          $ref: '#/components/schemas/ToolSourceAuth'
        createdAt:
          type: string
        enabled:
          type: boolean
        fleetId:
          type: string
        id:
          type: string
        namespace:
          type: string
        updatedAt:
          type: string
        version:
          type: number
        execution:
          $ref: '#/components/schemas/McpToolExecutionPolicy'
        type:
          type: string
          enum:
            - mcp
          x-stainless-const: true
        url:
          type: string
      required:
        - auth
        - createdAt
        - enabled
        - fleetId
        - id
        - namespace
        - updatedAt
        - version
        - type
        - url
    ToolApprovalMode:
      type: string
      enum:
        - always
        - never
    ToolSourceAuth:
      oneOf:
        - $ref: '#/components/schemas/NoToolSourceAuth'
          title: NoToolSourceAuth
          x-stainless-variantName: NoToolSourceAuth
        - $ref: '#/components/schemas/ApiKeyToolSourceAuth'
          title: ApiKeyToolSourceAuth
          x-stainless-variantName: ApiKeyToolSourceAuth
        - $ref: '#/components/schemas/OAuthExchangeToolSourceAuth'
          title: OAuthExchangeToolSourceAuth
          x-stainless-variantName: OAuthExchangeToolSourceAuth
        - $ref: '#/components/schemas/OAuthConnectionToolSourceAuth'
          title: OAuthConnectionToolSourceAuth
          x-stainless-variantName: OAuthConnectionToolSourceAuth
      discriminator:
        propertyName: kind
      description: >-
        Tool source authentication configuration. The `kind` field selects one
        of `none`, `api_key`, `oauth_exchange`, or `oauth_connection`.
      example:
        kind: none
    HttpToolExecutionPolicy:
      type: object
      properties:
        idempotencyKeyHeader:
          type: string
        maxAttempts:
          type: number
        retryMode:
          type: string
          enum:
            - disabled
            - safe_only
            - enabled
        timeoutMs:
          type: number
      description: HTTP tool execution retry and timeout policy.
      example:
        timeoutMs: 10000
        maxAttempts: 3
        retryMode: safe_only
    HttpToolDefinition:
      type: object
      properties:
        approval:
          $ref: '#/components/schemas/ToolApprovalMode'
        description:
          type: string
        endpoint:
          $ref: '#/components/schemas/HttpEndpoint'
        execution:
          $ref: '#/components/schemas/HttpToolExecutionPolicy'
        inputSchema:
          type: object
          description: JSON Schema object describing tool input parameters.
          example:
            type: object
          additionalProperties:
            x-stainless-any: true
        name:
          type: string
          example: search
        response:
          $ref: '#/components/schemas/ResponseNormalizationHint'
      required:
        - description
        - endpoint
        - inputSchema
        - name
      description: Definition for a single HTTP tool exposed by a tool source.
      example:
        name: search
        description: Search documents
        inputSchema:
          type: object
        endpoint:
          method: GET
          url: https://docs.example.com/search
    McpToolExecutionPolicy:
      type: object
      properties:
        discoveryTimeoutMs:
          type: number
        executionTimeoutMs:
          type: number
        maxAttempts:
          type: number
        retryMode:
          type: string
          enum:
            - disabled
            - connect_only
            - enabled
      description: MCP discovery and execution retry/timeout policy.
      example:
        discoveryTimeoutMs: 5000
        executionTimeoutMs: 30000
        maxAttempts: 2
        retryMode: connect_only
    NoToolSourceAuth:
      type: object
      properties:
        kind:
          type: string
          enum:
            - none
          x-stainless-const: true
      required:
        - kind
    ApiKeyToolSourceAuth:
      type: object
      properties:
        connectionId:
          type: string
          example: 9f063c59-2775-4614-8a68-22e5f90f92f3
        inject:
          $ref: '#/components/schemas/AuthInjection'
        kind:
          type: string
          enum:
            - api_key
          x-stainless-const: true
      required:
        - connectionId
        - inject
        - kind
    OAuthExchangeToolSourceAuth:
      type: object
      properties:
        exchange:
          $ref: '#/components/schemas/OAuthExchangeConfig'
        inject:
          $ref: '#/components/schemas/AuthInjection'
        kind:
          type: string
          enum:
            - oauth_exchange
          x-stainless-const: true
      required:
        - exchange
        - inject
        - kind
    OAuthConnectionToolSourceAuth:
      type: object
      properties:
        inject:
          $ref: '#/components/schemas/AuthInjection'
        kind:
          type: string
          enum:
            - oauth_connection
          x-stainless-const: true
        provider:
          type: string
          example: google
        requiredScopes:
          type: array
          items:
            type: string
      required:
        - kind
        - provider
    HttpEndpoint:
      type: object
      properties:
        body:
          type: string
          enum:
            - json_params
          x-stainless-const: true
        headers:
          type: object
          additionalProperties:
            type: string
        method:
          type: string
          enum:
            - GET
            - POST
            - PUT
            - PATCH
            - DELETE
        path:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ToolParamReference'
        query:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ToolParamReference'
        url:
          type: string
          example: https://docs.example.com/search
      required:
        - method
        - url
      description: HTTP endpoint invoked when the tool is called.
    ResponseNormalizationHint:
      type: object
      properties:
        mode:
          type: string
          enum:
            - auto
            - json
            - markdown
            - blob
      required:
        - mode
      description: How the HTTP response should be normalized for the agent.
    AuthInjection:
      oneOf:
        - $ref: '#/components/schemas/HeaderAuthInjection'
          title: HeaderAuthInjection
          x-stainless-variantName: HeaderAuthInjection
        - $ref: '#/components/schemas/QueryAuthInjection'
          title: QueryAuthInjection
          x-stainless-variantName: QueryAuthInjection
      discriminator:
        propertyName: location
      description: >-
        Where an API key or OAuth access token should be injected into outgoing
        tool-source requests.
    OAuthExchangeConfig:
      oneOf:
        - $ref: '#/components/schemas/ClientCredentialsOAuthExchange'
          title: ClientCredentialsOAuthExchange
          x-stainless-variantName: ClientCredentialsOAuthExchange
        - $ref: '#/components/schemas/JwtBearerOAuthExchange'
          title: JwtBearerOAuthExchange
          x-stainless-variantName: JwtBearerOAuthExchange
      discriminator:
        propertyName: grantType
      description: >-
        Source-owned OAuth exchange configuration. Public schemas use connection
        IDs for stored client secrets and assertions.
    ToolParamReference:
      type: string
      pattern: ^params\.[A-Za-z0-9_.-]+$
      description: Reference to a named tool input parameter.
      example: params.query
    HeaderAuthInjection:
      type: object
      properties:
        location:
          type: string
          enum:
            - header
          x-stainless-const: true
        name:
          type: string
          example: Authorization
        value:
          type: string
          description: >-
            Optional value template. For OAuth connection auth, use values such
            as `Bearer ${token}`.
          example: Bearer ${token}
      required:
        - location
        - name
    QueryAuthInjection:
      type: object
      properties:
        location:
          type: string
          enum:
            - query
          x-stainless-const: true
        name:
          type: string
          example: api_key
      required:
        - location
        - name
    ClientCredentialsOAuthExchange:
      type: object
      properties:
        audience:
          type: string
        clientId:
          type: string
          example: client_abc123
        clientSecretConnectionId:
          type: string
          example: 9f063c59-2775-4614-8a68-22e5f90f92f3
        extraParams:
          type: object
          additionalProperties:
            type: string
        grantType:
          type: string
          enum:
            - client_credentials
          x-stainless-const: true
        scopes:
          type: array
          items:
            type: string
        tokenUrl:
          type: string
          example: https://auth.example.com/oauth/token
      required:
        - clientId
        - clientSecretConnectionId
        - grantType
        - tokenUrl
    JwtBearerOAuthExchange:
      type: object
      properties:
        assertionConnectionId:
          type: string
          example: 9f063c59-2775-4614-8a68-22e5f90f92f3
        audience:
          type: string
          example: https://auth.example.com/oauth/token
        extraParams:
          type: object
          additionalProperties:
            type: string
        grantType:
          type: string
          enum:
            - jwt_bearer
          x-stainless-const: true
        issuer:
          type: string
          example: service-account@example.com
        scopes:
          type: array
          items:
            type: string
        subject:
          type: string
        tokenUrl:
          type: string
          example: https://auth.example.com/oauth/token
      required:
        - assertionConnectionId
        - audience
        - grantType
        - issuer
        - tokenUrl
  securitySchemes:
    bearerAuth:
      bearerFormat: Cerca API key
      scheme: bearer
      type: http

````