---
title: "Tools"
description: "REST endpoints for tools. Bearer-auth required."
section: "API"
group: "REST"
order: 72
---

## GET /api/tools

List tools.

**Query parameters**

- `limit` (optional): Page size (1–100, default 100).
- `after` (optional): Keyset cursor — return the page after this row (next page).
- `before` (optional): Keyset cursor — return the page before this row (prev page).
- `ids` (optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).
- `filter` (optional): Nested filter expression (`<Entity>Filter`): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.
- `orderBy` (optional): Multi-key sort (`<Entity>OrderBy[]`): array of `{ field: direction }` applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.
- `workspace_id` (optional): Filter to tools in this workspace. When omitted, returns tools across every workspace the caller is a member of (admins see all). System tools are always included.
- `source` (optional): Narrow by source. `workspace` = this workspace's tools plus those visible via installed integrations; `system` = only global system tools; `integration` = only tools made visible by installed integrations; omit = union.
- `agent_id` (optional): Filter to tools exposed to this agent (via the agent_tool join).
- `function_id` (optional): Filter to tools wrapping this specific function. Useful for finding every tool surface backed by a given function.
- `target` (optional): Narrow by dispatch target.
- `include_deleted` (optional): Soft-deleted tool visibility. `false` (default) — active rows only. `true` — active plus soft-deleted. `only` — soft-deleted only.
- `name` (optional): Case-insensitive substring match on name.
- `function_version_id` (optional): Shorthand: filter where `functionVersionId` equals this value.
- `input_schema_id` (optional): Shorthand: filter where `inputSchemaId` equals this value.
- `output_schema_id` (optional): Shorthand: filter where `outputSchemaId` equals this value.
- `requires_confirmation` (optional): Shorthand: filter where `requiresConfirmation` equals this value.
- `enabled` (optional): Shorthand: filter where `enabled` equals this value.
- `system` (optional): Shorthand: filter where `system` equals this value.
- `created_by` (optional): Shorthand: filter where `createdBy` equals this value.
- `runtime_user_id` (optional): Shorthand: filter where `runtimeUserId` equals this value.
- `retention_tier` (optional): Shorthand: filter where `retentionTier` equals this value.

**Response**

```json
{
  "data": [
    {
      "id": "<...>",
      "workspaceId": "<...>",
      "name": "<...>",
      "description": "<...>",
      "target": "<...>",
      "functionId": "<...>",
      "functionVersionId": "<...>",
      "inputSchemaId": "<...>",
      "outputSchemaId": "<...>",
      "examples": "<...>",
      "requiresConfirmation": "<...>",
      "enabled": "<...>",
      "system": "<...>",
      "createdBy": "<...>",
      "runtimeUserId": "<...>",
      "deletedAt": "<...>",
      "retentionTier": "<...>",
      "createdAt": "<...>",
      "updatedAt": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}
```

## POST /api/tools

Create tool

**Request body**

```json
{
  "workspaceId": "string",
  "name": "string",
  "description?": "string",
  "target": "server | client",
  "functionId?": "string",
  "functionVersionId?": "string",
  "inputSchemaId": "string",
  "outputSchemaId": "string",
  "examples?": ["<...>"],
  "requiresConfirmation?": "boolean",
  "enabled?": "boolean"
}
```

**Response**

```json
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "target": "server | client",
  "functionId": "string",
  "functionVersionId": "string",
  "inputSchemaId": "string",
  "outputSchemaId": "string",
  "examples": ["<...>"],
  "requiresConfirmation": "boolean",
  "enabled": "boolean",
  "system": "boolean",
  "createdBy": "string",
  "runtimeUserId": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}
```

## GET /api/tools/{id}

Get a tool by ID.

**Path parameters**

- `id` (required): Tool to retrieve.

**Response**

```json
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "target": "server | client",
  "functionId": "string",
  "functionVersionId": "string",
  "inputSchemaId": "string",
  "outputSchemaId": "string",
  "examples": ["<...>"],
  "requiresConfirmation": "boolean",
  "enabled": "boolean",
  "system": "boolean",
  "createdBy": "string",
  "runtimeUserId": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}
```

## PATCH /api/tools/{id}

Update tool

**Path parameters**

- `id` (required): The tool's prefixed ID (e.g. `tol_...`).

**Request body**

```json
{
  "name?": "string",
  "description?": "string",
  "functionId?": "string",
  "functionVersionId?": "string",
  "inputSchemaId?": "string",
  "outputSchemaId?": "string",
  "examples?": ["<...>"],
  "requiresConfirmation?": "boolean",
  "enabled?": "boolean",
  "runtimeUserId?": "string"
}
```

**Response**

```json
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "target": "server | client",
  "functionId": "string",
  "functionVersionId": "string",
  "inputSchemaId": "string",
  "outputSchemaId": "string",
  "examples": ["<...>"],
  "requiresConfirmation": "boolean",
  "enabled": "boolean",
  "system": "boolean",
  "createdBy": "string",
  "runtimeUserId": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}
```

## DELETE /api/tools/{id}

Soft-delete a tool.

**Path parameters**

- `id` (required): Tool to soft-delete.

**Response**

```json
{
  "success": "boolean"
}
```

## DELETE /api/tools/{id}/purge

Permanently delete a soft-deleted tool.

**Path parameters**

- `id` (required): Soft-deleted tool to permanently delete.

**Response**

```json
{
  "success": "boolean"
}
```

## POST /api/tools/{id}/restore

Restore a soft-deleted tool.

**Path parameters**

- `id` (required): Soft-deleted tool to restore.

**Response**

```json
{
  "id": "string",
  "workspaceId": "string",
  "name": "string",
  "description": "string",
  "target": "server | client",
  "functionId": "string",
  "functionVersionId": "string",
  "inputSchemaId": "string",
  "outputSchemaId": "string",
  "examples": ["<...>"],
  "requiresConfirmation": "boolean",
  "enabled": "boolean",
  "system": "boolean",
  "createdBy": "string",
  "runtimeUserId": "string",
  "deletedAt": "string",
  "retentionTier": "any",
  "createdAt": "string",
  "updatedAt": "string"
}
```
