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

# Retrieve Tools

> Retrieve a JSON list of all tools the user has access to



## OpenAPI

````yaml get /{resourceSlug}/tools.json
openapi: 3.0.0
info:
  title: Agentcloud Webapp API Docs
  description: The API docs for Agentcloud's webapp.
  version: 0.2.1
servers:
  - url: https://app.agentcloud.dev
    description: Use our public api endpoints!
  - url: '{custom_url}'
    description: Test the endpoints on your own instance of Agent Cloud!
    variables:
      custom_url:
        default: https://app.agentcloud.dev
security: []
tags: []
paths:
  /{resourceSlug}/tools.json:
    get:
      tags:
        - Tools
      summary: Retrieve Tools
      description: Retrieve a JSON list of all tools the user has access to
      operationId: toolsJson
      parameters:
        - name: resourceSlug
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ObjectId'
          description: >-
            The resourceSlug is a url parameter of the teamId associated with
            the user. Anywhere the resourceSlug is used can be interpreted as a
            teamId
      responses:
        '200':
          description: >-
            JSON object containing an array of all the tools associated tools
            with that teamId, will return an empty array if the request is
            successful but there are no associated tools.
          content:
            tools.json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Tool'
        '400':
          description: >-
            Invalid toolIds, modelIds or function calling modelIds. The content
            will contain an error message which will detail which field is
            incorrect.
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
        '403':
          description: >-
            Invalid Permissions on the resourceSlug, attempting to access a tool
            outside the permissions of the team
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
        '500':
          description: Internal error
          content:
            dynamicResponse:
              schema:
                $ref: '#/components/schemas/dynamicResponse'
components:
  schemas:
    ObjectId:
      description: >-
        Mongodb Object id, unique identifier, length of 24 characters fitting
        the following regex; [a-f0-9]{24}
      type: string
    Tool:
      type: object
      description: >-
        Represents a tool within the system, including its configuration, state,
        and associated retrievers.
      required:
        - name
        - description
        - type
        - data
      properties:
        _id:
          $ref: '#/components/schemas/ObjectId'
        orgId:
          $ref: '#/components/schemas/ObjectId'
          description: Identifier of the organization to which the tool belongs.
        teamId:
          $ref: '#/components/schemas/ObjectId'
          description: Identifier of the team to which the tool belongs.
        name:
          description: The name of the tool.
          type: string
        description:
          description: A detailed description of the tool.
          type: string
        type:
          $ref: '#/components/schemas/ToolType'
          description: The type of tool.
        asdf:
          description: The schema associated with the tool.
          type: string
        retriever_type:
          $ref: '#/components/schemas/Retriever'
          description: The type of retriever used by the tool.
        retriever_config:
          $ref: '#/components/schemas/RetrieverConfig'
          description: Configuration settings for the retriever.
        datasourceId:
          $ref: '#/components/schemas/ObjectId'
          description: Identifier of the datasource associated with the tool.
        state:
          $ref: '#/components/schemas/ToolState'
          description: The current state of the tool.
        data:
          type: object
          description: >-
            Data related to the tool, including runtime, environment variables,
            and more.
          required:
            - name
          properties:
            runtime:
              description: The runtime environment for the tool.
              type: string
            builtin:
              description: Indicates if the tool is a built-in feature.
              type: boolean
            name:
              description: The name of the data.
              type: string
            description:
              description: A description of the data.
              type: string
            apiKey:
              description: API key associated with the tool.
              type: string
            environmentVariables:
              description: Environment variables required by the tool.
              type: object
              additionalProperties:
                type: string
            parameters:
              type: object
              description: Parameters for the tool's function.
              properties:
                properties:
                  description: Properties of the function parameters.
                  type: object
                  additionalProperties:
                    $ref: '#/components/schemas/FunctionProperty'
                required:
                  description: List of required parameter names.
                  type: array
                  items:
                    type: string
            code:
              description: Code associated with the tool.
              type: string
            requirements:
              description: Requirements needed by the tool.
              type: string
            openAPIMatchKey:
              description: Key used to match OpenAPI specifications.
              type: string
        icon:
          $ref: '#/components/schemas/IconAttachment'
          description: Icon associated with the tool.
        hidden:
          description: Indicates whether the tool is hidden.
          type: boolean
        functionId:
          description: Identifier of the function associated with the tool.
          type: string
        revisionId:
          $ref: '#/components/schemas/ObjectId'
          description: Identifier of the tool's revision.
        functionLogs:
          description: Logs related to the function's execution.
          type: string
    dynamicResponse:
      description: Server response
      properties:
        message:
          type: string
          description: Error message to provide more detail
        code:
          type: integer
          description: the error code
    ToolType:
      type: string
      description: Enum representing different types of tools.
      enum:
        - function
        - rag
    Retriever:
      type: string
      description: Enum representing different types of retrievers used in tools.
      enum:
        - raw
        - self_query
        - time_weighted
        - multi_query
    RetrieverConfig:
      type: object
      description: Union type representing different retriever configurations.
      oneOf:
        - $ref: '#/components/schemas/SelfQueryRetrieverConfig'
        - $ref: '#/components/schemas/TimeWeightedRetrieverConfig'
    ToolState:
      type: string
      description: Enum representing the possible states of a tool.
      enum:
        - pending
        - ready
        - error
    FunctionProperty:
      type: object
      description: Defines the properties of a function parameter in a tool.
      required:
        - type
        - description
      properties:
        type:
          description: The data type of the function property.
          type: string
        description:
          description: A description of the function property.
          type: string
    IconAttachment:
      description: Attachment, generally used for image upload
      required:
        - id
        - filename
      properties:
        id:
          description: >-
            this is NOT a unique id for the IconAttachment, this is a Mongo id
            that links to an Asset object (neet to implement assets in docs)
          additionalProperties:
            $ref: '#/components/schemas/ObjectId'
        filename:
          type: string
          description: Filename of the attachment at the point of upload
    SelfQueryRetrieverConfig:
      type: object
      description: Configuration for the self-query retriever.
      required:
        - metadata_field_info
      properties:
        k:
          description: Number of results to retrieve.
          type: integer
          format: int32
        metadata_field_info:
          description: Array of metadata field information objects.
          type: array
          items:
            $ref: '#/components/schemas/MetadataFieldInfo'
    TimeWeightedRetrieverConfig:
      type: object
      description: Configuration for the time-weighted retriever.
      properties:
        k:
          description: Number of results to retrieve.
          type: integer
          format: int32
        decay_rate:
          description: Decay rate applied to the time weighting.
          type: number
          format: float
    MetadataFieldInfo:
      type: object
      description: Information about a metadata field used in retriever configurations.
      required:
        - name
        - description
        - type
      properties:
        name:
          description: The name of the metadata field.
          type: string
        description:
          description: A description of the metadata field.
          type: string
        type:
          description: The data type of the metadata field.
          type: string
          enum:
            - string
            - integer
            - float

````