v3

latestOpenAPI 3.0.02026-08-081996601.2 MB
Tools

Create tool

Creates a tool that agents can call. Tools give agents capabilities to interact with external systems, process data, query corpora, or run custom logic. Agents select and invoke tools dynamically based on their instructions and the current session.

The platform provides several built-in tools, and you can also create your own. This endpoint supports two tool types:

  • Lambda tools, which run user-defined Python functions in a secure sandbox.
  • Client tools, which the calling client executes. The platform emits a tool_input event, and the client submits the result as a tool_output input.

A lambda tool can declare its own tool_configurations. These are named configurations of other tools. The lambda tool's Python code calls them as functions through the built-in tool module. They stay private to the tool. $ref values in their argument_override resolve against the hosting agent and session. See CreateLambdaToolRequest.tool_configurations for the contract and examples.

Each tool includes:

  • A unique tool ID
  • A description of its purpose
  • An input schema that describes accepted parameters
  • Optional metadata
  • An enabled flag that controls runtime availability

Artifact-based tools

Some built-in tools work with artifacts stored in a session:

  • Document conversion tool: Converts file artifacts (PDF, Word, PowerPoint, images with OCR support) to markdown and produces new artifacts that contain the extracted content.

These tools operate on artifact references rather than file content. This supports multi-step workflows where agents process or index user-uploaded documents.

post/v2/tools

Headers

Request-Timeoutinteger

The platform makes a best effort to complete the request in the specified seconds, or it times out.

Request-Timeout-Millisinteger

The platform makes a best effort to complete the request in the specified milliseconds, or it times out.

Request body

OR

Example request

{
  "type": "lambda",
  "name": "calculate_customer_score",
  "title": "Customer Score Calculator",
  "description": "Calculate a customer score based on order history and revenue. Returns a score between 0-100.",
  "language": "python",
  "code": "def process(order_count: int, total_revenue: float, days_active: int = 1) -> dict:\n    score = (order_count * 10 + total_revenue * 0.1) / days_active\n    return {'score': round(score, 2)}\n",
  "execution_configuration": {
    "max_execution_time_seconds": 30,
    "max_memory_mb": 100
  },
  "tool_configurations": {
    "fetch_status": {
      "type": "web_get",
      "argument_override": {
        "url": "https://status.example.com/api/health"
      }
    }
  }
}

Response

The tool is created.

OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR
OR

Example response

{
  "id": "tol_123e4567-e89b-12d3-a456-426614174000",
  "default_output_transform": ".results | map({title, url})",
  "default_input_transform": ".args + { auth: (\"Bearer \" + .agent.secrets.token) }",
  "default_argument_override": {
    "max_results": 10
  },
  "lineage": "corpora_search",
  "version": "2026-02-23",
  "tool_groups": [
    "document_ingestion"
  ],
  "type": "dynamic_vectara"
}