LangChain tools API

The tools API from LangChain — 3 operation(s) for tools.

OpenAPI Specification

langchain-tools-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: LangSmith access_policies tools API
  description: 'The LangSmith API is used to programmatically create and manage LangSmith resources.


    ## Host

    https://api.smith.langchain.com


    ## Authentication

    To authenticate with the LangSmith API, set the `X-Api-Key` header

    to a valid [LangSmith API key](https://docs.langchain.com/langsmith/create-account-api-key#create-an-api-key).


    '
  version: 0.1.0
servers:
- url: /
tags:
- name: tools
paths:
  /v1/platform/tools:
    get:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Returns a paginated list of tools in the workspace.
      tags:
      - tools
      summary: List tools
      parameters:
      - description: Maximum number of tools to return
        name: limit
        in: query
        schema:
          type: integer
          title: Limit
      - description: Number of tools to skip
        name: offset
        in: query
        schema:
          type: integer
          title: Offset
      - description: Search query to filter tools by name or description
        name: query
        in: query
        schema:
          type: string
          title: Query
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ListToolsResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
    post:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Creates a new tool in the workspace.
      tags:
      - tools
      summary: Create a tool
      parameters: []
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.Tool'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/tools.CreateToolPayload'
  /v1/platform/tools/id/{id}:
    get:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Returns a tool identified by its UUID.
      tags:
      - tools
      summary: Get a tool by ID
      parameters:
      - description: Tool UUID
        name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.Tool'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
    delete:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Deletes a tool identified by its UUID.
      tags:
      - tools
      summary: Delete a tool by ID
      parameters:
      - description: Tool UUID
        name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
    patch:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Updates an existing tool identified by its UUID.
      tags:
      - tools
      summary: Update a tool by ID
      parameters:
      - description: Tool UUID
        name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.Tool'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/tools.UpdateToolPayload'
  /v1/platform/tools/{handle}:
    get:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Returns a tool identified by its handle.
      tags:
      - tools
      summary: Get a tool by handle
      parameters:
      - description: Tool handle
        name: handle
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.Tool'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
    delete:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Deletes a tool identified by its handle.
      tags:
      - tools
      summary: Delete a tool by handle
      parameters:
      - description: Tool handle
        name: handle
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
    patch:
      security:
      - API Key: []
      - Tenant ID: []
      - Bearer Auth: []
      description: Updates an existing tool identified by its handle.
      tags:
      - tools
      summary: Update a tool by handle
      parameters:
      - description: Tool handle
        name: handle
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.Tool'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/tools.ErrorResponse'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/tools.UpdateToolPayload'
components:
  schemas:
    tools.ListToolsResponse:
      type: object
      properties:
        next_offset:
          type: integer
        tools:
          type: array
          items:
            $ref: '#/components/schemas/tools.Tool'
        total:
          type: integer
    tools.CreateToolPayload:
      type: object
      required:
      - description
      - handle
      - name
      - parameters
      properties:
        description:
          type: string
        enabled:
          type: boolean
        handle:
          type: string
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
        parameters:
          type: object
          additionalProperties: true
        returns:
          type: object
          additionalProperties: true
    tools.UpdateToolPayload:
      type: object
      properties:
        description:
          type: string
        enabled:
          type: boolean
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
        parameters:
          type: object
          additionalProperties: true
        returns:
          type: object
          additionalProperties: true
    tools.Tool:
      type: object
      properties:
        created_at:
          type: string
        description:
          type: string
        enabled:
          type: boolean
        handle:
          type: string
        id:
          type: string
        metadata:
          type: object
          additionalProperties: true
        name:
          type: string
        parameters:
          type: object
          additionalProperties: true
        returns:
          type: object
          additionalProperties: true
        tenant_id:
          type: string
        updated_at:
          type: string
    tools.ErrorResponse:
      type: object
      properties:
        error:
          description: Error message
          type: string
  securitySchemes:
    API Key:
      type: apiKey
      in: header
      name: X-API-Key
    Tenant ID:
      type: apiKey
      in: header
      name: X-Tenant-Id
    Bearer Auth:
      type: http
      description: Bearer tokens are used to authenticate from the UI. Must also specify x-tenant-id or x-organization-id (for org scoped apis).
      scheme: bearer
    Organization ID:
      type: apiKey
      in: header
      name: X-Organization-Id