> For the complete documentation index, see [llms.txt](https://developer.celigo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.celigo.com/cli/commands/tools.md).

# tools

Builder-mode tools are reusable building blocks that encapsulate lookups, imports, transforms, and conditional routing behind input/output contracts. They're callable from flows, APIs, AI agents, MCP servers, and other tools.

Outside callers reach a tool too. A caller holding a full-access API token or a personal access token runs it directly with `invoke` (`POST /v1/tools/{_id}/invoke`); a token cannot be scoped to a tool. An MCP server publishes a tool to AI clients. Put an API in front of a tool only when callers need their own URL, method, and status codes.

**REST API**: [Tools](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools)

```
celigo tools <subcommand> [args] [flags]
```

Supports all [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md).

***

## Subcommands

| Subcommand                                                 | Purpose                                                                                                                                                                         |
| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `list`                                                     | List all tools.                                                                                                                                                                 |
| `get <id>`                                                 | Fetch one tool by ID.                                                                                                                                                           |
| `create`                                                   | Create a tool from a JSON body (`--file <path>` or stdin).                                                                                                                      |
| `update <id>`                                              | Full replace from a JSON body (`--file <path>` or stdin); destructive `PUT`.                                                                                                    |
| `set <id> key=value …`                                     | Safe field edit: `name`, `description`, `aiDescription`, `input.debugUntil`, and `output.debugUntil` via atomic PATCH, others GET → modify → PUT. Supports `key=file://<path>`. |
| `delete <id>`                                              | Delete a tool.                                                                                                                                                                  |
| `dependencies <id>` (alias `used-by`)                      | List resources that depend on this tool.                                                                                                                                        |
| `audit <id>`                                               | Show the tool's audit log (change history).                                                                                                                                     |
| `graph [ref]`                                              | Render the tool's Flow Builder graph from the local tree, offline — as JSON, Mermaid, or DOT. Added in celigo-cli 2026.9.1.                                                     |
| `add-processor <id> <exportOrImportId>`                    | Add a page processor (export or import) to the tool.                                                                                                                            |
| `remove-processor <id> <exportOrImportId>`                 | Remove a page processor by its export/import ID.                                                                                                                                |
| `test-run <id>`                                            | Start a test run and return stage-by-stage results.                                                                                                                             |
| `test-run-step-results <id> <runId> <exportOrImportId>`    | Get stage-by-stage results for a test run step.                                                                                                                                 |
| `test-run-step-logs <id> <runId> <exportOrImportId>`       | List HTTP request/response logs for a test run step.                                                                                                                            |
| `debug-requests <id> <exportOrImportId>`                   | List debug request log entries for a step, or for the tool's own Input or Output stage.                                                                                         |
| `debug-request-detail <id> <exportOrImportId> <key>`       | Get full request/response detail for one log entry.                                                                                                                             |
| `delete-debug-requests <id> <exportOrImportId> <keys...>`  | Delete captured debug request records for one step, by key. Added in celigo-cli 2026.9.6.                                                                                       |
| `connections <id>`                                         | List the connections used by a tool.                                                                                                                                            |
| `replace-connection <id> <connectionId> <newConnectionId>` | Repoint every step that uses one connection to another, in one call. Added in celigo-cli 2026.9.6.                                                                              |
| `download <id>`                                            | Download the tool as a template ZIP.                                                                                                                                            |
| `clone <id>`                                               | Clone a tool into a target integration.                                                                                                                                         |
| `invoke <id>`                                              | Invoke the saved tool synchronously and print its mapped output. `--log-mode debug` records the run for `request-history`.                                                      |
| `request-history <id>`                                     | List the tool's recorded runs — the run index. Added in celigo-cli 2026.9.6.                                                                                                    |
| `execution-logs <toolId> <executionId>`                    | Print one run's execution log (the trace view); `--details` assembles the full picture. Added in celigo-cli 2026.9.6.                                                           |
| `delete-execution-logs <id>`                               | Queue deletion of stored invocation logs in a date range. Added in celigo-cli 2026.9.6.                                                                                         |
| `logs <id>`                                                | List the legacy file-backed request/response envelopes stored for the tool. Added in celigo-cli 2026.9.6.                                                                       |
| `log-detail <id> <key>`                                    | Fetch one stored request/response envelope in full. Added in celigo-cli 2026.9.6.                                                                                               |
| `delete-logs <id> <keys...>`                               | Delete stored envelopes by key. Added in celigo-cli 2026.9.6.                                                                                                                   |

***

## `celigo tools list`

List all tools in the account. Rows are projected to `_id`, `name`, and the table columns by default; `--fields all` returns complete documents.

**Signature**

```bash
celigo tools list [--fields <spec>] [--limit <n>]
```

**Flags**

| Flag              | Type    | Default   | Description                                                                                                                                                                                                                                                                                  |
| ----------------- | ------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--fields <spec>` | string  | `default` | Fields to request per row: `default` (`_id`, `name`, and the table columns), `all` (complete documents), or a comma-separated field list (dot notation allowed). See [field projection](https://developer.celigo.com/cli/getting-started/global-flags.md#field-projection-on-list-commands). |
| `--limit <n>`     | integer | —         | Return at most `<n>` rows, fetching a single page.                                                                                                                                                                                                                                           |

Default table columns: `_id`, `name`, `_integrationId`, `lastModified`. Since celigo-cli 2026.10.1, `--fields a,b,…` with `--format table` draws `_id`, `name`, and the fields you name instead.

**Example**

```bash
celigo tools list
```

**Corresponds to**: [`GET /v1/tools`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#get-v1-tools)

***

## `celigo tools get`

Fetch one tool by ID.

**Signature**

```bash
celigo tools get <id>
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Example**

```bash
celigo tools get 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`GET /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#get-v1-tools-_id)

***

## `celigo tools create`

Create a tool from a JSON body. Read the body from a file with `-f, --file` (recommended), or pipe it on stdin.

Since celigo-cli 2026.10.1, the body is checked before it is sent. It is validated against the published API schemas — the pack [`celigo lint`](https://developer.celigo.com/cli/local-tree/lint-and-resolve.md#celigo-lint) uses: a field the spec does not document, a wrong JSON type, or a value outside an enum prints a `warning` line on stderr, and the tool is still created. Refused before any request, with no override: a body that is not a JSON object, masked `"******"` credential placeholders, and a responseMapping object wrapper (or `null`, or the `[null]`/`[{}]` it leaves behind) in a step's `responseMapping` — the platform accepts those and erases the step's mappings.

Since celigo-cli 2026.10.2, a router whose `script` is `null` is refused too, with no override. The platform stores it, but Flow Builder crashes when it opens that router. A router with no script leaves the `script` key out.

**Signature**

```bash
celigo tools create --file <path>
celigo tools create < tool.json     # or pipe on stdin
```

**Flags**

| Flag                | Type   | Default | Description                                                                                                  |
| ------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------ |
| `-f, --file <path>` | string | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1. |

**Request body**

A JSON object matching the `POST /v1/tools` request schema (input/output schemas, routers, branches, page processors, lookups, hooks).

**Example**

```bash
celigo tools create --file ./tool.json
```

**Corresponds to**: [`POST /v1/tools`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#post-v1-tools)

***

## `celigo tools update`

Full replace of a tool from a JSON body (`--file <path>` or stdin). `PUT` is destructive — any field omitted from the payload is erased. Prefer `set` for targeted edits.

> ⚠️ **`update` replaces the entire tool.** `PUT` erases any field you omit — routers, branches, page processors, hooks. `GET` the tool first, edit it, then send the complete object back, or use `set` for targeted edits.

Since celigo-cli 2026.10.1, the body is checked against the published API schemas before the PUT (when it has findings, the current tool is read first, so only what the update adds or changes is reported); findings are stderr warnings and never block. A body that is not a JSON object, and a responseMapping object wrapper or `null` in a step's `responseMapping`, are refused with no override — `--force` included. On an Integration App's tool (`_connectorId` set), the platform answers `200` and keeps its own value for every field the app locks: each field the update changed whose reply still holds the previous value is named on stderr, and the command exits `1`.

Since celigo-cli 2026.10.2, a router whose `script` is `null` is refused the same way, with no override, even one copied from a `GET`. Flow Builder crashes when it opens that router, so leave the key out.

**Signature**

```bash
celigo tools update <id> --file <path>
celigo tools update <id> < tool.json     # or pipe on stdin
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag                | Type    | Default | Description                                                                                                                                                                                                                                                |
| ------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-f, --file <path>` | string  | —       | Read the JSON body from a file instead of stdin (`--file -` also means stdin). Added in celigo-cli 2026.6.1.                                                                                                                                               |
| `--force`           | boolean | `false` | Submit even if the body contains masked credential values (`"******"`) copied from a `GET`. Since celigo-cli 2026.10.1, a masked value is four or more asterisks and nothing else: a lone `*` (a wildcard, for example) is a value and needs no `--force`. |

**Request body**

The complete tool document, matching the `PUT /v1/tools/{_id}` request schema.

**Example**

```bash
celigo tools get 5f8d43a1b9e5a80011a35f2c | jq '.name = "Renamed tool"' | celigo tools update 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`PUT /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#put-v1-tools-_id)

***

## `celigo tools set`

Edit one or more fields on a tool without rewriting the whole document. `name`, `description`, and `aiDescription` — the server's PATCH whitelist — are applied as one atomic `PATCH` since celigo-cli 2026.9.6; every other field goes `GET` → apply assignments → `PUT` with the complete document, so omitted fields survive. A `key=file://<path>` value loads that field's value from a file instead of the command line; a leading `~` and paths relative to the current directory are supported. Added in celigo-cli 2026.6.1.

Since celigo-cli 2026.10.1, the tool's two debug windows join the whitelist: `input.debugUntil=<iso>` or `output.debugUntil=<iso>` opens a window and `=null` closes it, each as one atomic `PATCH` instead of a PUT of the whole tool. Tools have no `enable-debug`, so these assignments are how `operate` mode reaches a tool's debug windows: in `operate` mode `set` takes only `input.debugUntil` and `output.debugUntil`, and refuses any other field. `set --help` names the group's own whitelist.

Since celigo-cli 2026.10.1, `set` also checks what it sends and what landed:

* The assigned values (PATCH) or the document a GET + PUT would send are checked against the published API schemas; findings are stderr warnings and never block. A GET + PUT that would send a responseMapping object wrapper or `null` is refused.
* After a GET + PUT, a field the server's reply still holds at its previous value prints `not stored <field> the server answered the PUT but still holds its previous value …` on stderr, and the command exits `1`. On an Integration App's tool (`_connectorId` set), one stderr line names the fields the app kept instead — `celigo: tools set: the platform kept its own value for <fields> — the Integration App locks them` — and the command exits `1`.

Since celigo-cli 2026.10.2, a GET + PUT that would send back a router whose `script` is `null` is refused, because Flow Builder crashes when it opens that router. Add `'routers[<n>].script=null'` to the same `set`: assigning `null` removes the key. That assignment on its own repairs a tool that already holds one. A `set` of whitelisted fields only is a `PATCH`, which never sends the routers.

**Signature**

```bash
celigo tools set <id> <key=value> [key=value ...]
```

**Arguments**

| Argument      | Type   | Required | Description                                                                                                                                                                                                   |
| ------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `<id>`        | string | Yes      | Tool ID.                                                                                                                                                                                                      |
| `<key=value>` | string | Yes (≥1) | Field assignment(s). Dot + bracket notation supported (e.g. `routers[0].branches[0].name=Primary`). Values auto-parse as JSON; `null` removes the field. Use `key=file://<path>` to load a value from a file. |

**Example**

```bash
# One atomic PATCH — every field is whitelisted
celigo tools set 5f8d43a1b9e5a80011a35f2c name="Customer lookup" aiDescription="Looks up a customer by id"

# GET → modify → PUT — disabled is not on the whitelist
celigo tools set 5f8d43a1b9e5a80011a35f2c name="Customer lookup" disabled=false

# Open the input debug window until 18:00 UTC, then close it — one PATCH each, allowed in operate mode
celigo tools set 5f8d43a1b9e5a80011a35f2c input.debugUntil=2026-10-17T18:00:00Z
celigo tools set 5f8d43a1b9e5a80011a35f2c input.debugUntil=null

# Remove the first router's null script — Flow Builder crashes opening that router
celigo tools set 5f8d43a1b9e5a80011a35f2c 'routers[0].script=null'
```

**Corresponds to**: an atomic `PATCH /v1/tools/{_id}` when every assigned field is `name`, `description`, `aiDescription`, `input.debugUntil`, or `output.debugUntil`; otherwise [`GET /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#get-v1-tools-_id) then [`PUT /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#put-v1-tools-_id)

***

## `celigo tools delete`

Delete a tool by ID. Prompts for confirmation unless `-y` is passed.

> ⚠️ **Deleting a tool cannot be undone.** Flows, APIs, MCP servers, and AI agents that reference this tool will fail. Run `celigo tools dependencies <id>` first to confirm nothing depends on it.

**Signature**

```bash
celigo tools delete <id> [flags]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag        | Type    | Default | Description                   |
| ----------- | ------- | ------- | ----------------------------- |
| `-y, --yes` | boolean | `false` | Skip the confirmation prompt. |

**Example**

```bash
celigo tools delete 5f8d43a1b9e5a80011a35f2c -y
```

**Corresponds to**: [`DELETE /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#delete-v1-tools-_id) (operationId: `deleteTool`)

***

## `celigo tools dependencies`

List resources that depend on this tool (alias: `used-by`). Use it to check whether a tool is safe to delete — an empty result means nothing references it. Since celigo-cli 2026.10.1, an id that matches no tool answers with the tool's `404` instead of an empty result, so a typo never reads as safe to delete.

**Signature**

```bash
celigo tools dependencies <id>
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Example**

```bash
celigo tools dependencies 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`GET /v1/tools/{_id}/dependencies`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) (operationId: `listToolDependencies`)

***

## `celigo tools audit`

Show the audit log (change history) for one tool. Since celigo-cli 2026.10.1, every page of the log is read (the endpoint pages at 1,000 entries), and the table columns are `_id`, `resourceType`, `event`, `source`, `byUser.email`, and `time`.

**Signature**

```bash
celigo tools audit <id>
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Example**

```bash
celigo tools audit 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`GET /v1/tools/{_id}/audit`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools)

***

## `celigo tools graph`

Render a tool's Flow Builder graph from the local tree, offline — the tool's input as the one source, the steps and branchings, and its output as the terminal, as the canvas draws them. Each step carries its name, category, application, and step components (filters, mappings, hooks, response mapping, error handling), resolved through the tree that `celigo pull` wrote. See [The local tree](https://developer.celigo.com/cli/local-tree.md). Added in celigo-cli 2026.9.1.

The graph is rendered from the documents on disk, so no profile or token is needed and the command is never mode-gated. `[ref]` is a tree path, a link, a resource folder, `type:id`, or a bare id. Any `tool.json` on disk works through `--file` (`-` for stdin), but its references stay unresolved unless the file sits in a pulled tree. A `flow:`, `api:`, or `tool:` ref renders with its own builder's shape from any of the three groups, and a `--file` document whose shape names no builder renders as a tool. The JSON output is the graph the Celigo VS Code extension's Flow Canvas consumes ([VS Code extension](https://developer.celigo.com/cli/vscode-extension.md)); `--as mermaid` renders natively in GitHub pull requests, and `--as dot` is Graphviz input. The full contract is the same as [`flows graph`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-graph). Since celigo-cli 2026.11.2, a `[ref]` given beside `--file` is refused; earlier releases read the file and ignored the ref.

**Signature**

```bash
celigo tools graph [ref] [--dir <path>] [--as json|mermaid|dot] [--file <path>] [--status] [--no-components]
```

**Arguments**

| Argument | Type   | Required | Description                                                                                                                                                                                                                                                            |
| -------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `[ref]`  | string | No       | The tool to render: a tree path, a link, a resource folder, `tool:<id>` (or `flow:`/`api:`), or a bare id. Required unless `--file` is given; with neither, the command exits `1` with `Provide a ref (a tree path, type:id, or id) or --file <path> ('-' for stdin).` |

**Flags**

| Flag              | Type                         | Default | Description                                                                                                                                                                                    |
| ----------------- | ---------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--dir <path>`    | string                       | `.`     | Tree root directory.                                                                                                                                                                           |
| `--as <format>`   | `json` \| `mermaid` \| `dot` | `json`  | Output format. `json` is the graph the VS Code canvas consumes; `mermaid` renders natively in GitHub pull requests; `dot` is for Graphviz.                                                     |
| `--file <path>`   | string                       | —       | Read the document from a file instead of the tree (`-` for stdin). References render unresolved unless the file sits in a pulled tree.                                                         |
| `--status`        | boolean                      | `false` | Add the tree's `celigo status` state (`clean`, `modified`, `missing`, or `untracked`) for the document and each step's resource. In `mermaid`/`dot` output the states appear as comment lines. |
| `--no-components` | boolean                      | `false` | Leave the step component chips out of `mermaid`/`dot` output.                                                                                                                                  |

**Example**

```bash
# From inside a pulled tree
celigo tools graph tool:5f8d43a1b9e5a80011a35f2c

# Graphviz, with the tree's status for the tool and each step
celigo tools graph "integrations/Order to Cash/tools/Ranking Tool/tool.json" --as dot --status
```

**Corresponds to**: no API call — the graph is built from the local tree.

***

## `celigo tools add-processor`

Add a page processor (export or import) to a tool. Auto-detects whether the target ID is an export or an import. If the tool has no routers yet, a default router + branch is created. Since celigo-cli 2026.10.1, the command says why it could not look the step up (a `401`, a `403`, the network) instead of calling the id invalid, and never writes when that lookup did not succeed; a `--branch` name that two branches of the router share is refused.

Since celigo-cli 2026.10.2, a tool that holds a router whose `script` is `null` is refused before the confirmation prompt, and nothing is sent. The command PUTs back the copy it read, so the refusal names the `set` to run first: `celigo tools set <id> 'routers[<n>].script=null'`.

**Signature**

```bash
celigo tools add-processor <id> <exportOrImportId> [flags]
```

**Arguments**

| Argument             | Type   | Required | Description                                        |
| -------------------- | ------ | -------- | -------------------------------------------------- |
| `<id>`               | string | Yes      | Tool ID.                                           |
| `<exportOrImportId>` | string | Yes      | Export or import ID to attach as a page processor. |

**Flags**

| Flag                    | Type    | Default | Description                       |
| ----------------------- | ------- | ------- | --------------------------------- |
| `--router <routerId>`   | string  | —       | Target a specific router by ID.   |
| `--branch <branchName>` | string  | —       | Target a specific branch by name. |
| `-y, --yes`             | boolean | `false` | Skip the confirmation prompt.     |

**Example**

```bash
celigo tools add-processor 5f8d43a1b9e5a80011a35f2c 62abc123... --router r1 -y
```

**Corresponds to**: [`GET /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#get-v1-tools-_id) then [`PUT /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#put-v1-tools-_id)

***

## `celigo tools remove-processor`

Remove a page processor from a tool by its export or import ID. Since celigo-cli 2026.10.1, a step that sits in more than one branch is refused unless `--router` and `--branch` say which one (it used to be removed from the first); `--branch` alone removes it from the named branch, and `--router` alone finds the branch of that router that holds it.

Since celigo-cli 2026.10.2, a tool that holds a router whose `script` is `null` is refused before the confirmation prompt, as `add-processor` refuses it, and nothing is sent. Run the `set` the refusal names first: `celigo tools set <id> 'routers[<n>].script=null'`.

**Signature**

```bash
celigo tools remove-processor <id> <exportOrImportId> [flags]
```

**Arguments**

| Argument             | Type   | Required | Description                                     |
| -------------------- | ------ | -------- | ----------------------------------------------- |
| `<id>`               | string | Yes      | Tool ID.                                        |
| `<exportOrImportId>` | string | Yes      | Export or import ID of the processor to remove. |

**Flags**

| Flag                    | Type    | Default | Description                       |
| ----------------------- | ------- | ------- | --------------------------------- |
| `--router <routerId>`   | string  | —       | Target a specific router by ID.   |
| `--branch <branchName>` | string  | —       | Target a specific branch by name. |
| `-y, --yes`             | boolean | `false` | Skip the confirmation prompt.     |

**Example**

```bash
celigo tools remove-processor 5f8d43a1b9e5a80011a35f2c 62abc123... -y
```

**Corresponds to**: [`GET /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#get-v1-tools-_id) then [`PUT /v1/tools/{_id}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools#put-v1-tools-_id)

***

## `celigo tools test-run`

Start a test run of a tool and return stage-by-stage results. Returns metadata (stages per step), `flowJob`, and `childJobs`. The CLI sends `triggeredAt` automatically. Requires `operate` mode.

Since celigo-cli 2026.10.1, `--file` supplies the run's input: a tool takes `{"input": {...}}`, and a bare object is wrapped as the input. Without `--file` the tool runs against an empty record. A body that is not a JSON object is refused: `The test input must be a JSON object.`

A test run saves each lookup step's response on its export as `mockOutput`. Later test runs answer that lookup from it, whatever their input, so a stale lookup result comes from the export, not the tool. Remove the export's `mockOutput` to test against the live system again.

The reply holds counts only. A failed run's errors, each with its `code`, `message`, and `classification`, are in the step's results: read them with [`test-run-step-results <id> <flowJob._id> <childJobs[]._expOrImpId>`](#celigo-tools-test-run-step-results). Since celigo-cli 2026.11.2, after a run with an error, a note on stderr names that command for each failed step that recorded a stage. A failed step that the metadata lists no stage for has no results to read: its step results answer `404`. For such a step, the note says to check the step's connection with [`connections ping`](https://developer.celigo.com/cli/commands/connections.md#celigo-connections-ping-less-than-id-greater-than). A run that comes back `canceled` with no error gets a note that says so.

**Signature**

```bash
celigo tools test-run <id> [--file <path>]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag                  | Type   | Default | Description                                                                                                                                                   |
| --------------------- | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--export <exportId>` | string | —       | Export ID (page generator). Not required for tools; accepted for parity with `flows test-run`.                                                                |
| `-f, --file <path>`   | string | —       | Read the test input (JSON) from a file (`-` reads stdin): `{"input": {...}}`, or a bare object, which is wrapped as the input. Added in celigo-cli 2026.10.1. |

**Example**

```bash
celigo tools test-run 5f8d43a1b9e5a80011a35f2c

# With a test input — a bare object is wrapped as {"input": …}
echo '{"customerId": "C-1042"}' > test-input.json
celigo tools test-run 5f8d43a1b9e5a80011a35f2c --file test-input.json
```

**Corresponds to**: [`POST /v1/tools/{_id}/test/run`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools)

***

## `celigo tools test-run-step-results`

Get stage-by-stage results for a single step within a test run. Step IDs and `runId` come from the `test-run` response. Base64-encoded responses are decoded automatically.

**Signature**

```bash
celigo tools test-run-step-results <id> <runId> <exportOrImportId>
```

**Arguments**

| Argument             | Type   | Required | Description                                 |
| -------------------- | ------ | -------- | ------------------------------------------- |
| `<id>`               | string | Yes      | Tool ID.                                    |
| `<runId>`            | string | Yes      | Test run ID returned by `test-run`.         |
| `<exportOrImportId>` | string | Yes      | Step ID (export or import) within the tool. |

**Example**

```bash
celigo tools test-run-step-results 5f8d43a1b9e5a80011a35f2c run_abc123 62abc123...
```

**Corresponds to**: [`GET /v1/tools/{_id}/test/run/{runId}/{exportOrImportId}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools)

***

## `celigo tools test-run-step-logs`

List HTTP request/response logs for a step in a test run. Logs are only recorded for steps that issued outbound HTTP calls (exports, imports, lookups). Routers and stages that didn't make HTTP requests return `404 Not Found` by design. Since celigo-cli 2026.10.1, the CLI replaces that `404` with an explanation: `No request/response logs for step <exportOrImportId> in run <runId>. Logs are only recorded for steps that issued outbound HTTP calls. Check the test-run metadata for a step with a 'lookup' or 'request' stage.`

**Signature**

```bash
celigo tools test-run-step-logs <id> <runId> <exportOrImportId>
```

**Arguments**

| Argument             | Type   | Required | Description                         |
| -------------------- | ------ | -------- | ----------------------------------- |
| `<id>`               | string | Yes      | Tool ID.                            |
| `<runId>`            | string | Yes      | Test run ID.                        |
| `<exportOrImportId>` | string | Yes      | Step ID with an HTTP-issuing stage. |

**Example**

```bash
celigo tools test-run-step-logs 5f8d43a1b9e5a80011a35f2c run_abc123 62abc123...
```

**Corresponds to**: [`GET /v1/tools/{_id}/test/run/{runId}/{exportOrImportId}/logs/requestAndResponse`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools)

***

## `celigo tools debug-requests`

List debug request log entries for an export or import referenced by a tool. Requires `debugUntil` to be set on the export or import (use `exports enable-debug` / `imports enable-debug`).

For the tool's own Input and Output stages, pass `tool_input` or `tool_output` as `<exportOrImportId>`. Each record that entered or left the tool is listed with its schema outcome (`422` for a failed check). Records are captured while the tool's `input.debugUntil` or `output.debugUntil` is ahead: open the window with [`tools set`](#celigo-tools-set), for at most 60 minutes.

JSON output is the API's envelope (`requests`, `nextPageURL`), unchanged. Since celigo-cli 2026.10.1:

* `--format table` lists one request per row — `key` (never cut, for `debug-request-detail`), `time`, `statusCode`; a tool step's key already holds its method and stage — instead of the envelope in one cell.
* The listing can be paged. `--time-gt`/`--time-lte` (epoch milliseconds) set the window in place of `--since`, and `--next-page-token` takes the continuation token. When more requests exist, a table names the next page's values on stderr — `Note: more requests exist; for the next page, repeat the command with --time-gt <ms> --next-page-token <token>.` — and says to leave out `--since` when you passed it.
* `--since` and `--time-gt` together are refused (`--since and --time-gt both set the window's lower bound; pass one.`), and `--since` must be a positive whole number of minutes (`0` and `abc` used to become 60).

Since celigo-cli 2026.11.2, a blank `--next-page-token` (an unset shell variable) is refused before the request.

**Signature**

```bash
celigo tools debug-requests <id> <exportOrImportId> [--since <minutes> | --time-gt <ms>] [--time-lte <ms>] [--next-page-token <token>]
```

**Arguments**

| Argument             | Type   | Required | Description                                                                                                 |
| -------------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------- |
| `<id>`               | string | Yes      | Tool ID.                                                                                                    |
| `<exportOrImportId>` | string | Yes      | Export or import ID to inspect, or `tool_input` / `tool_output` for the tool's own Input and Output stages. |

**Flags**

| Flag                        | Type               | Default | Description                                                                                                                                     |
| --------------------------- | ------------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `--since <minutes>`         | number             | `60`    | Show requests from the last N minutes.                                                                                                          |
| `--time-gt <ms>`            | epoch milliseconds | —       | Lower bound of the window (exclusive), in place of `--since`. Sent as `time_gt`. Added in celigo-cli 2026.10.1.                                 |
| `--time-lte <ms>`           | epoch milliseconds | —       | Upper bound of the window (inclusive). Sent as `time_lte`. Added in celigo-cli 2026.10.1.                                                       |
| `--next-page-token <token>` | string             | —       | Continuation token from the previous page's `nextPageURL` (a table names it on stderr). Sent as `nextPageToken`. Added in celigo-cli 2026.10.1. |

**Example**

```bash
celigo tools debug-requests 5f8d43a1b9e5a80011a35f2c 62abc123... --since 15

# The tool's own Input stage: open its window, then list what entered the tool
celigo tools set 5f8d43a1b9e5a80011a35f2c input.debugUntil=2026-10-17T18:00:00Z
celigo tools debug-requests 5f8d43a1b9e5a80011a35f2c tool_input --format table

# The next page, with the values the table named on stderr
celigo tools debug-requests 5f8d43a1b9e5a80011a35f2c 62abc123... --format table \
  --time-gt 1792300000000 --next-page-token <token>
```

**Corresponds to**: [`GET /v1/tools/{_id}/{exportOrImportId}/requests?time_gt=<ms>`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools), plus `time_lte` and `nextPageToken` when given.

***

## `celigo tools debug-request-detail`

Get full request/response detail for a single debug log entry.

**Signature**

```bash
celigo tools debug-request-detail <id> <exportOrImportId> <key>
```

**Arguments**

| Argument             | Type   | Required | Description                          |
| -------------------- | ------ | -------- | ------------------------------------ |
| `<id>`               | string | Yes      | Tool ID.                             |
| `<exportOrImportId>` | string | Yes      | Export or import ID.                 |
| `<key>`              | string | Yes      | Log entry key from `debug-requests`. |

**Example**

```bash
celigo tools debug-request-detail 5f8d43a1b9e5a80011a35f2c 62abc123... <key>
```

**Corresponds to**: [`GET /v1/tools/{_id}/{exportOrImportId}/requests/{key}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) (operationId: `getToolStepRequest`)

***

## `celigo tools delete-debug-requests`

Delete captured debug request records for one tool step, by the `key` values `tools debug-requests` lists. Returns `{deleted[], errors[]}`. Prompts for confirmation unless you pass `-y`. Requires `operate` mode. Added in celigo-cli 2026.9.6.

**Signature**

```bash
celigo tools delete-debug-requests <id> <exportOrImportId> <keys...> [-y]
```

**Arguments**

| Argument             | Type              | Required | Description                                              |
| -------------------- | ----------------- | -------- | -------------------------------------------------------- |
| `<id>`               | string            | Yes      | Tool ID.                                                 |
| `<exportOrImportId>` | string            | Yes      | Export or import ID of the step whose records to delete. |
| `<keys...>`          | string (variadic) | Yes      | One or more log entry keys from `tools debug-requests`.  |

**Flags**

| Flag        | Type    | Default | Description                   |
| ----------- | ------- | ------- | ----------------------------- |
| `-y, --yes` | boolean | `false` | Skip the confirmation prompt. |

**Example**

```bash
celigo tools delete-debug-requests 5f8d43a1b9e5a80011a35f2c 6a1b2c3d4e5f6a7b8c9d0e1f 01H9XK7M... 01H9XK7N... -y
```

**Corresponds to**: [`DELETE /v1/tools/{_id}/{exportOrImportId}/requests`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) with `{"keys": [...]}` as the body.

***

## `celigo tools connections`

List the connections used by a tool — every connection referenced by the tool's exports and imports.

**Signature**

```bash
celigo tools connections <id>
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Example**

```bash
celigo tools connections 5f8d43a1b9e5a80011a35f2c
```

**Corresponds to**: [`GET /v1/tools/{_id}/connections`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) (operationId: `listToolConnections`)

***

## `celigo tools replace-connection`

Repoint every export and import step in the tool's routers that uses one connection to another, in one call — the same verb as [`flows replace-connection`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-replace-connection). Both connections must exist in the account, and the new one must be of the same type. `tools connections <id>` lists the candidates. Requires `full` mode. Added in celigo-cli 2026.9.6.

**Signature**

```bash
celigo tools replace-connection <id> <connectionId> <newConnectionId>
```

**Arguments**

| Argument            | Type   | Required | Description                                                 |
| ------------------- | ------ | -------- | ----------------------------------------------------------- |
| `<id>`              | string | Yes      | Tool ID.                                                    |
| `<connectionId>`    | string | Yes      | The connection the steps use today.                         |
| `<newConnectionId>` | string | Yes      | The connection to point them at — same type as the old one. |

**Flags**

Uses [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md) only.

**Example**

```bash
celigo tools replace-connection 5f8d43a1b9e5a80011a35f2c 5f8d43a1b9e5a80011a35f2e 60a1b2c3d4e5f6a7b8c9d0e1
```

**Corresponds to**: [`PUT /v1/tools/{_id}/replaceConnection`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) with `{"_connectionId": "...", "_newConnectionId": "..."}`. The CLI prints the server's response, or a one-line confirmation when the response is empty.

***

## `celigo tools download`

Download a tool as a template ZIP file. Use it to version a tool in git, or to move one between accounts.

The CLI requests the template, follows the signed URL, and writes the file locally.

Since celigo-cli 2026.10.1, an existing destination file is refused unless you pass `--force`, and so are a directory and a path whose directory does not exist — before the template is requested: `./templates/address-lookup.zip already exists; refusing to overwrite it. Pass --force to replace it, or choose another destination.` A leading `~` in `-o` means your home directory, and the archive is staged in a temporary file beside the target and renamed into place, so a failure mid-write never leaves a truncated archive.

**Signature**

```bash
celigo tools download <id> [-o <path>] [--force]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag                  | Type    | Default           | Description                                                                                                               |
| --------------------- | ------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `-o, --output <path>` | string  | `<tool-name>.zip` | Output file path. Without it, the CLI writes `<tool-name>.zip` in the current directory, falling back to `tool-<id>.zip`. |
| `--force`             | boolean | `false`           | Replace the destination file if it already exists. Added in celigo-cli 2026.10.1.                                         |

**Example**

```bash
celigo tools download 5f8d43a1b9e5a80011a35f2c

# A stable path for a git-tracked export
celigo tools download 5f8d43a1b9e5a80011a35f2c -o ./templates/address-lookup.zip
```

**Corresponds to**: [`GET /v1/tools/{_id}/template`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools), which returns a short-lived signed URL. The CLI then downloads the archive from that URL.

***

## `celigo tools clone`

Clone a tool into a target integration. Returns a manifest of every created resource as `[{model, _id}]` tuples. Requires `full` mode, like every other clone.

Connection-less tools clone with no body. Tools whose steps reference connections require a connection map, piped via stdin or `--file` — the server rejects such clones without one, even within the same environment:

* Same-env clone — map each connection to itself: `{"connectionMap":{"connId":"connId"}}`
* Cross-env clone — map source to target: `{"connectionMap":{"sourceConnId":"targetConnId"}}`

Since celigo-cli 2026.10.1, a body that is not a JSON object is refused before any request (such a body used to be ignored); a body piped without `--file` gets one second to start arriving and is then read to its end, while `--file -` waits until the pipe closes; and a clone is never resent after a timeout or a `5xx`, so a slow clone that landed is not created twice. Since celigo-cli 2026.11.1, a clone is not resent after a `429` either; earlier releases retried it.

A tool whose hooks or wrapper connections run on a [stack](https://developer.celigo.com/cli/commands/stacks.md) clones only when the request names one. Without it, the platform refuses the clone with `400 stack_not_found`. Since celigo-cli 2026.10.2, `--stack-id <id>` sends the stack as `_stackId`. A string `_stackId` in the piped body is sent too, and `--stack-id` wins when both are given.

Since celigo-cli 2026.11.2, a blank `--integration`, `--name`, or `--stack-id` (an unset shell variable) is refused before any request.

**Signature**

```bash
celigo tools clone <id> --integration <integrationId> [--name <name>] [-f <path>] [--stack-id <id>]
```

**Arguments**

| Argument | Type   | Required | Description     |
| -------- | ------ | -------- | --------------- |
| `<id>`   | string | Yes      | Source tool ID. |

**Flags**

| Flag                            | Type   | Default        | Description                                                                                                                                                                                                                                                                        |
| ------------------------------- | ------ | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--integration <integrationId>` | string | —              | **Required.** Target integration for the clone.                                                                                                                                                                                                                                    |
| `--name <name>`                 | string | server default | Name for the cloned tool.                                                                                                                                                                                                                                                          |
| `-f, --file <path>`             | string | —              | Read the `connectionMap` body from a file instead of stdin (`-` waits for stdin to close; a body piped without `--file` must start arriving within 1s).                                                                                                                            |
| `--stack-id <id>`               | string | —              | Stack the copy's hooks and wrapper connections run on (sent as `_stackId`). Required when the tool's hooks or wrapper connections run on a stack: without one the platform answers `400 stack_not_found`. Wins over a `_stackId` in the piped body. Added in celigo-cli 2026.10.2. |

**Example**

```bash
# A tool with one connection, cloned within the same environment
echo '{"connectionMap":{"5f8d43a1b9e5a80011a35f2e":"5f8d43a1b9e5a80011a35f2e"}}' \
  | celigo tools clone 5f8d43a1b9e5a80011a35f2c --integration 60a1b2c3d4e5f6a7b8c9d0e1 --name "Customer lookup (staging)"

# A connection-less tool whose hooks run on a stack
celigo tools clone 5f8d43a1b9e5a80011a35f2c --integration 60a1b2c3d4e5f6a7b8c9d0e1 --stack-id 60a1b2c3d4e5f6a7b8c9d0e3
```

**Corresponds to**: [`POST /v1/tools/{_id}/clone`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools), with `_integrationId` in the body, plus `name`, `connectionMap`, and `_stackId` when given.

***

## `celigo tools invoke`

Invoke a saved tool synchronously and print its mapped output. Requires `operate` mode.

The body is `{"input": {...}, "overrides": {...}}` from stdin or `--file` — a bare object is wrapped as the `input` automatically. Any tool step that references a connection requires `overrides.connections: [{"_abstractId": "<connId>", "_id": "<connId>"}]` (mapping a connection to itself is accepted).

Since celigo-cli 2026.10.1, a body that names `overrides` is read as the envelope even without `input` (the input is then empty); it used to be wrapped under `input`, which dropped the connection bindings. A body that is not a JSON object is refused before any request, and an invoke is never resent after a timeout or a `5xx`, so a slow run that landed does not run twice. Since celigo-cli 2026.11.1, an invoke is not resent after a `429` either; earlier releases retried it. Since celigo-cli 2026.11.2, a blank `--log-mode` (an unset shell variable) is refused; it used to run the tool with no log mode.

Since celigo-cli 2026.11.1, the credentials the output carries print as `********`: the value of each credential header, and a captured request URL's userinfo and credential query parameters. See [Credentials in a run's result](https://developer.celigo.com/cli/using-the-cli/output-formats.md#credentials-in-a-runs-result).

**Signature**

```bash
celigo tools invoke <id> [--file <path>] [--log-mode <mode>]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag                | Type                                     | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ------------------- | ---------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-f, --file <path>` | string                                   | —       | Read the body from a file instead of stdin (`--file -` also means stdin).                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `--log-mode <mode>` | `debug \| basic \| standard \| detailed` | —       | Record this run in the tool's execution logs (sent as the `x-log-mode` header). Only `debug` takes effect for a direct invoke like this one — `basic`, `standard`, and `detailed` are accepted but the server only honors them when an AI agent or MCP server invokes the tool. A recorded run shows up in `tools request-history`, and its trace in `tools execution-logs`. Recording requires the enterprise Tool-logging entitlement; without it a `debug` invoke succeeds but records nothing. |

**Example**

```bash
echo '{"input": {"customerId": "C-1042"}, "overrides": {"connections": [{"_abstractId": "5f8d43a1b9e5a80011a35f2e", "_id": "5f8d43a1b9e5a80011a35f2e"}]}}' \
  | celigo tools invoke 5f8d43a1b9e5a80011a35f2c --log-mode debug
```

**Corresponds to**: [`POST /v1/tools/{_id}/invoke`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools)

***

## `celigo tools request-history`

List a tool's recorded runs — the run index behind the UI's Request history panel: one entry per invocation that ran with logging enabled. Defaults to the last 5 minutes; widen the window with `--time-gte`/`--time-lte`. Added in celigo-cli 2026.9.6.

This is [jobs](https://developer.celigo.com/cli/commands/jobs.md)' analog for tools: pick an entry's `executionId` here, then drill into that run with `tools execution-logs`. A run is recorded when the invoke enabled logging — AI agent, MCP server, and guardrail invocations that had it on, and direct invokes made with `tools invoke --log-mode debug`. Recording requires the enterprise Tool-logging entitlement; without it a `debug` invoke succeeds but records nothing. Sandbox tools return `403`.

Distinct from `tools logs`, which returns the legacy file-backed request/response envelopes — use `request-history` for run history, `tools logs` for the raw decoded request and response of a single call.

JSON output is the API's envelope (`invocations`, `_pagination`), as before. Since celigo-cli 2026.10.1, `--format table` lists one run per row — `executionId`, `time`, `invokerType`, `status` — instead of the envelope with the runs in one cell, and when more runs exist it names the next page on stderr: `Note: more runs exist; for the next page, repeat the command with --next <time> --cursor-execution-id <id>.` Pass both values, with the same filters, to read that page.

Since celigo-cli 2026.11.2, the filters are checked before the request. A blank filter value (an unset shell variable) is refused, and so are a `--time-gte` later than `--time-lte`, a `--page-size` that is not a positive whole number, and a `--sort-order` other than `asc` or `desc`.

**Signature**

```bash
celigo tools request-history <id> [filters] [--next <time> --cursor-execution-id <id>]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag                            | Type          | Default       | Description                                                                                                                                                                        |
| ------------------------------- | ------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--time-gte <iso>`              | ISO 8601      | 5 minutes ago | Include runs at or after this timestamp.                                                                                                                                           |
| `--time-lte <iso>`              | ISO 8601      | now           | Include runs at or before this timestamp.                                                                                                                                          |
| `--status <status>`             | string        | —             | Filter by run status (single value or comma-separated list).                                                                                                                       |
| `--invoker-type <type>`         | string        | —             | Filter by invoker type (single value or comma-separated list). Sent as `invokerType`.                                                                                              |
| `--invoker-id <id>`             | string        | —             | Filter by the direct caller's resource id — an AI agent, MCP server, or guardrail. Sent as `_invokerId`.                                                                           |
| `--invoker-integration-id <id>` | string        | —             | Narrow results to one invoker integration id. Sent as `_invokerIntegrationId`.                                                                                                     |
| `--trace-key-prefix <prefix>`   | string        | —             | Filter on `traceKey` (prefix match). Sent as `traceKeyPrefix`.                                                                                                                     |
| `--page-size <n>`               | integer       | —             | Entries per page (clamped to 100). Sent as `pageSize`.                                                                                                                             |
| `--sort-order <dir>`            | `asc \| desc` | —             | Sort direction by invocation time. Sent as `sortOrder`.                                                                                                                            |
| `--next <time>`                 | string        | —             | Read the page after this cursor: the `next` value of the previous page's `nextPageUrl` (a table names it on stderr). Needs `--cursor-execution-id`. Added in celigo-cli 2026.10.1. |
| `--cursor-execution-id <id>`    | string        | —             | The page cursor's tie-breaker: the `cursorExecutionId` value of the previous page's `nextPageUrl`. Needs `--next`. Added in celigo-cli 2026.10.1.                                  |

**Example**

```bash
# Everything recorded in the last hour, newest first
celigo tools request-history 5f8d43a1b9e5a80011a35f2c \
  --time-gte "$(date -u -v-1H +%FT%TZ)" --sort-order desc

# Only the runs one MCP server made through this tool
celigo tools request-history 5f8d43a1b9e5a80011a35f2c --invoker-id 60a1b2c3d4e5f6a7b8c9d0e1

# The next page, with the two values the table named on stderr
celigo tools request-history 5f8d43a1b9e5a80011a35f2c --format table \
  --next 2026-10-17T09:15:02.418Z --cursor-execution-id exec_01J9XK7M
```

**Corresponds to**: [`GET /v1/tools/{_id}/invocations`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) with the filters above as query parameters.

***

## `celigo tools execution-logs`

Print one run's execution log: the trace header plus one record per step/stage event. The per-run layer under `request-history`, exactly as [`flows execution-logs <flowId> <jobId>`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-execution-logs) is the per-run layer under `jobs`. Get the `executionId` from `tools request-history`. Added in celigo-cli 2026.9.6.

Since celigo-cli 2026.10.1, a run the platform has no trace for exits `1` with a message instead of printing `null`: `No execution log for run <executionId>: it is not <toolId>'s, not visible to this token, or not written yet — a trace lands a few seconds after the run, so try again shortly.`

**Signature**

```bash
celigo tools execution-logs <toolId> <executionId> [--details]
```

**Arguments**

| Argument        | Type   | Required | Description                                |
| --------------- | ------ | -------- | ------------------------------------------ |
| `<toolId>`      | string | Yes      | Tool ID.                                   |
| `<executionId>` | string | Yes      | Execution ID from `tools request-history`. |

**Flags**

| Flag        | Type    | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--details` | boolean | `false` | Assemble the run's complete picture in one command. Each step record gains `data`, its decoded payload: the answer for the record's own `stage` or, for a record that names none (most do), one answer per stage its step runs, keyed by stage — `schemaValidation` for a tool's input and output, `tool` and `responseMapping` for a nested tool, `mapping`, `apiCall`, and `responseMapping` for an export or import. Records that fanned out gain `children` (first page only, each child with its own `data`), and payloads too large to inline gain a short-lived `downloadUrl` on their S3 reference. A failed sub-fetch is reported in place as `{"error": ...}` instead of failing the command. |

Since celigo-cli 2026.10.1, `--details` attaches each step's payloads: trace records rarely name a `stage`, and the command used to query only the records that did, so it attached none. At most eight detail requests run at once, each failure reported in place, and the payload queries are allowed in `read` mode.

**Example**

```bash
celigo tools execution-logs 5f8d43a1b9e5a80011a35f2c exec_01J9XK7M --details
```

**Corresponds to**: [`GET /v1/tools/{_id}/invocations/{executionId}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools). With `--details`, the CLI also issues the per-record drill-down calls beneath that path — `POST .../logs/data/query` for each step record's payload (a read-only `POST`), `GET .../{exportOrImportId}/logs/{recordId}/children` for fan-out, and `GET .../logs/signedURL?s3Key=...` for each offloaded payload section.

***

## `celigo tools delete-execution-logs`

Queue deletion of a tool's stored invocation logs within an inclusive date range. Irreversible. Both bounds are required, and the end must not be in the future. Prompts for confirmation unless you pass `-y`. Requires `operate` mode. Added in celigo-cli 2026.9.6.

Since celigo-cli 2026.11.2, the window is checked before the prompt and the request: each bound must be a timestamp, `--time-gte` must be earlier than `--time-lte` (equal bounds are refused), and `--time-lte` must not be in the future.

**Signature**

```bash
celigo tools delete-execution-logs <id> --time-gte <iso> --time-lte <iso> [-y]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag               | Type     | Default | Description                                                           |
| ------------------ | -------- | ------- | --------------------------------------------------------------------- |
| `--time-gte <iso>` | ISO 8601 | —       | **Required.** Start of the deletion window, inclusive.                |
| `--time-lte <iso>` | ISO 8601 | —       | **Required.** End of the deletion window (must not be in the future). |
| `-y, --yes`        | boolean  | `false` | Skip the confirmation prompt.                                         |

**Example**

```bash
celigo tools delete-execution-logs 5f8d43a1b9e5a80011a35f2c \
  --time-gte 2026-07-01T00:00:00Z --time-lte 2026-07-31T23:59:59Z -y
```

**Corresponds to**: [`DELETE /v1/tools/{_id}/invocations?time_gte=<iso>&time_lte=<iso>`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) — unlike the `apis` twin, the tools endpoint takes the range under the same `time_gte`/`time_lte` names as the flags.

***

## `celigo tools logs`

List the request/response envelopes stored for a tool as a whole — the legacy file-backed log store, the twin of [`apis logs`](https://developer.celigo.com/cli/commands/apis.md#celigo-apis-logs-less-than-id-greater-than). Distinct from `request-history`, the run index: use `logs` for the raw decoded request and response of a single call, keyed by `key`, and `tools log-detail <id> <key>` for one envelope in full. Added in celigo-cli 2026.9.6.

JSON output is the API's envelope (`requests`, `nextPageURL`), as before. Since celigo-cli 2026.10.1:

* `--method` and `--status-code` take several values, or the flag repeated, and any of them matches; each value is sent as its own query parameter. A repeated flag used to keep only the last value.
* `--time-gt` and `--time-lte` are checked before the request: both take epoch milliseconds (`--time-gt takes epoch milliseconds (e.g. 1790000000000), not '2026-10-01'.`), and `--time-lte` needs `--time-gt` (`--time-lte needs --time-gt: the endpoint takes an upper bound only together with a lower one.`).
* `--format table` lists one request per row — `key` (never cut, for `log-detail` and `delete-logs`), `time`, `method`, `statusCode` — instead of the whole envelope in one cell. While more of the window remains, it names on stderr the `--time-gt`, `--time-lte`, and `--next-page-token` values that read the next page.

Since celigo-cli 2026.11.2, a blank `--method`, `--status-code`, or `--next-page-token` (an unset shell variable) is refused before the request.

**Signature**

```bash
celigo tools logs <id> [--time-gt <ms>] [--time-lte <ms>] [--method <methods...>] [--status-code <codes...>] [--next-page-token <token>]
```

**Arguments**

| Argument | Type   | Required | Description |
| -------- | ------ | -------- | ----------- |
| `<id>`   | string | Yes      | Tool ID.    |

**Flags**

| Flag                        | Type               | Default | Description                                                                                                                           |
| --------------------------- | ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `--time-gt <ms>`            | epoch milliseconds | —       | Lower bound of the window (exclusive). Sent as `time_gt`.                                                                             |
| `--time-lte <ms>`           | epoch milliseconds | —       | Upper bound of the window (inclusive). Requires `--time-gt`. Sent as `time_lte`.                                                      |
| `--method <methods...>`     | string (variadic)  | —       | Only entries with these HTTP methods — several values, or the flag repeated, match any. Sent as one `method` parameter per value.     |
| `--status-code <codes...>`  | string (variadic)  | —       | Only entries with these status codes — several values, or the flag repeated, match any. Sent as one `statusCode` parameter per value. |
| `--next-page-token <token>` | string             | —       | Continuation token from the previous page's `nextPageURL` (a table names it on stderr). Sent as `nextPageToken`.                      |

**Example**

```bash
# Failed calls in the last 15 minutes
celigo tools logs 5f8d43a1b9e5a80011a35f2c \
  --time-gt "$(( $(date +%s) * 1000 - 900000 ))" --status-code 500

# Writes that were throttled or failed — any of the methods, any of the codes
celigo tools logs 5f8d43a1b9e5a80011a35f2c --method POST PUT PATCH DELETE --status-code 429 500 502 503

# The next page
celigo tools logs 5f8d43a1b9e5a80011a35f2c --next-page-token <token>
```

**Corresponds to**: [`GET /v1/tools/{_id}/logs`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) with the filters above as query parameters.

***

## `celigo tools log-detail`

Get the full stored request/response envelope for one captured tool request. The `key` comes from `tools logs` and is used exactly as returned. Added in celigo-cli 2026.9.6.

**Signature**

```bash
celigo tools log-detail <id> <key>
```

**Arguments**

| Argument | Type   | Required | Description                      |
| -------- | ------ | -------- | -------------------------------- |
| `<id>`   | string | Yes      | Tool ID.                         |
| `<key>`  | string | Yes      | Log entry key from `tools logs`. |

**Flags**

Uses [global flags](https://developer.celigo.com/cli/getting-started/global-flags.md) only.

**Example**

```bash
celigo tools log-detail 5f8d43a1b9e5a80011a35f2c 01H9XK7M...
```

**Corresponds to**: [`GET /v1/tools/{_id}/logs/{key}`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools)

***

## `celigo tools delete-logs`

Delete stored request/response envelopes by the `key` values `tools logs` lists. Returns `{deleted[], errors[]}` — a key that no longer exists is reported in `errors`, not fatal. Prompts for confirmation unless you pass `-y`. Requires `operate` mode. Added in celigo-cli 2026.9.6.

**Signature**

```bash
celigo tools delete-logs <id> <keys...> [-y]
```

**Arguments**

| Argument    | Type              | Required | Description                                   |
| ----------- | ----------------- | -------- | --------------------------------------------- |
| `<id>`      | string            | Yes      | Tool ID.                                      |
| `<keys...>` | string (variadic) | Yes      | One or more log entry keys from `tools logs`. |

**Flags**

| Flag        | Type    | Default | Description                   |
| ----------- | ------- | ------- | ----------------------------- |
| `-y, --yes` | boolean | `false` | Skip the confirmation prompt. |

**Example**

```bash
celigo tools delete-logs 5f8d43a1b9e5a80011a35f2c 01H9XK7M... 01H9XK7N... -y
```

**Corresponds to**: [`DELETE /v1/tools/{_id}/logs`](https://developer.celigo.com/api/api-reference/exports-imports-and-tools/tools) with `{"keys": [...]}` as the body.

***

## Gotchas

* **`invoke` is the synchronous call; `test-run` is the development harness.** `invoke` runs the saved tool with a real input and prints its mapped output; `test-run` returns stage-by-stage results for debugging. (Before celigo-cli 2026.8.7 there was no direct invocation — you had to expose the tool through an API or MCP server.)
* **`invoke` needs connection overrides.** Any step that references a connection requires `overrides.connections` in the body, even mapping each connection to itself. Log mode is chosen per invoke — the tool resource stores no logging setting, and only `debug` records a direct invoke. A recorded run is what `request-history` lists and `execution-logs` prints.
* **A run's result prints its credentials as `********`.** Since celigo-cli 2026.11.1, `invoke`, `test-run`, `test-run-step-results`, `test-run-step-logs`, `debug-request-detail`, `execution-logs`, and `log-detail` mask the value of each credential header, and a captured URL's userinfo and credential query parameters. `get` prints the tool as stored. Since celigo-cli 2026.11.2, `request-history` masks the credentials in a run's `relativeURI` the same way. See [Credentials in a run's result](https://developer.celigo.com/cli/using-the-cli/output-formats.md#credentials-in-a-runs-result).
* **`request-history` and `logs` are two different stores.** `request-history` is the run index — one entry per invocation recorded with logging enabled — and `execution-logs <toolId> <executionId>` is one run's step-by-step trace beneath it, the same two-layer split as `jobs` and `flows execution-logs`. `logs`, `log-detail`, and `delete-logs` are the legacy file-backed store of raw request/response envelopes for the tool as a whole, keyed by `key`, like `apis logs`. Use the first pair to follow a run, the second to read exactly what one call sent and received.
* **`request-history` only shows recorded runs.** Recording requires the enterprise Tool-logging entitlement — without it a `debug` invoke succeeds and records nothing — and sandbox tools return `403`. Agent, MCP server, and guardrail invocations are recorded when their logging was on; a direct `invoke` only with `--log-mode debug`.
* **`clone` requires a connection map when steps reference connections.** The server rejects such clones without one, even same-env — map each connection to itself. A tool whose hooks or wrapper connections run on a stack also needs `--stack-id` (celigo-cli 2026.10.2); without it the platform answers `400 stack_not_found`.
* **`test-run` answers lookups from `mockOutput`.** A test run saves each lookup step's response on its export as `mockOutput`, and later test runs answer that lookup from it, whatever their input. Remove the export's `mockOutput` to test against the live system again.
* **A Tool that runs as a flow step is traced from the flow.** In a flow run's execution logs, a Tool step gets one entry per record for its whole chain, and the steps inside the tool get none. Since celigo-cli 2026.11.2, [`flows query-execution-logs --tool-import-id`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-query-execution-logs) lists the steps inside the tool, [`flows execution-log-detail --stage tool`](https://developer.celigo.com/cli/commands/flows.md#celigo-flows-execution-log-detail) holds the tool's input and output, and [`jobs list --type tool`](https://developer.celigo.com/cli/commands/jobs.md#celigo-jobs-list) lists the run's Tool step jobs.
* **`input` and `output` are JSON Schemas.** Every tool must declare an input schema and an output schema; callers are validated against them.
* **`PUT` replaces the whole tool.** Use `set` for targeted edits; `update` will erase any field you omit. `set` sends `name`, `description`, `aiDescription`, `input.debugUntil`, and `output.debugUntil` as an atomic `PATCH` and round-trips everything else through GET → modify → PUT with the complete document.
* **`add-processor` auto-creates a router.** If the tool has no routers, the first `add-processor` call creates a default router and a single branch. Use `--router` / `--branch` once you have more than one.
* **A router with no script leaves the `script` key out.** The platform stores `"script": null`, but Flow Builder crashes when it opens that router. Since celigo-cli 2026.10.2, `create`, `update`, `set`, `add-processor`, and `remove-processor` refuse a tool that holds one, with no override. Repair a tool that already holds one with `celigo tools set <id> 'routers[<n>].script=null'`. [`celigo lint`](https://developer.celigo.com/cli/local-tree/lint-and-resolve.md#celigo-lint) reports one as an error, and [`celigo push`](https://developer.celigo.com/cli/local-tree/push.md) refuses one at plan time.
* **A step's debug logs require `debugUntil` on the referenced export/import.** For the tool's own Input and Output stages, pass `tool_input` or `tool_output` instead; they record while the tool's `input.debugUntil` or `output.debugUntil` is ahead. `delete-debug-requests` removes captured records for one step by the keys `debug-requests` lists.
* **A tool's own debug windows are `set` fields.** Tools have no `enable-debug`; since celigo-cli 2026.10.1, `set <id> input.debugUntil=<iso>` or `output.debugUntil=<iso>` opens a window and `=null` closes it, one atomic `PATCH` each, in `operate` mode too.
* **The delete verbs differ in mode.** `delete-debug-requests`, `delete-execution-logs`, and `delete-logs` are operational cleanups and run in `operate` mode, like `invoke` and `test-run`; since celigo-cli 2026.10.1 `read` mode refuses all five before any request. `replace-connection` rewrites the tool's steps and needs `full`. `request-history`, `execution-logs` (with `--details`), `logs`, and `log-detail` are reads. See [Profiles & regions](https://developer.celigo.com/cli/getting-started/profiles.md#permission-modes).

## Related

* [apis](https://developer.celigo.com/cli/commands/apis.md) — put an API in front of a tool when callers need their own URL, method, and status codes.
* [mcp-servers](https://developer.celigo.com/cli/commands/mcp-servers.md) — expose a tool to MCP clients.
* [ai-agents](https://developer.celigo.com/cli/commands/ai-agents.md) — AI agents can call tools as part of their reasoning loop.
* [flows](https://developer.celigo.com/cli/commands/flows.md) — reference a tool as a step inside a flow.
* [connections](https://developer.celigo.com/cli/commands/connections.md) — `tools connections` lists the ones a tool's steps use; `replace-connection` repoints them.
* [jobs](https://developer.celigo.com/cli/commands/jobs.md) — the run index for flows; `tools request-history` is its analog for tools.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.celigo.com/cli/commands/tools.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
