> For the complete documentation index, see [llms.txt](https://www.openclawbook.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.openclawbook.xyz/en/appendices/appendix-c-tool-definition-reference.md). Agents can also search and read this documentation through its [MCP server](https://www.openclawbook.xyz/~gitbook/mcp).

# Appendix C: Tool Definition Reference

> **Generated by**: Claude Opus 5 (claude-opus-5\[1m]) **Token usage**: Input \~365,000 tokens, Output \~9,000 tokens **Source baseline**: `v2026.3.9` (`v2026.3.8-170-g665f67726`) **Sources of truth**: `src/agents/pi-tools.ts` (assembly line), `src/agents/tools/`, `src/agents/bash-tools.*.ts` — every tool name checked individually

***

Read alongside: **Chapter 22** (tool system overview), **§22.5** (source deep dive: assembly pipeline and sandbox).

> **Important premise**: the tool set is not fixed. `createOpenClawCodingTools()` generates it dynamically on every run through seven layers of policy filtering — the same `browser` tool has completely different availability in an owner's main session, a group chat, and a sandboxed subagent (§22.5.1). The table below is the **superset**, not any single run's actual tool set.

## C.1 Files and Shell

| Tool          | Purpose               | Key parameters                                                  | Origin                                                                                                 |
| ------------- | --------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `read`        | Read a file           | `filePath, offset?, limit?`                                     | pi base tool, replaced by an OpenClaw version with **image sanitization + window-aware output budget** |
| `write`       | Write a file          | `filePath, content`                                             | Swapped for an fs-bridge version under sandbox                                                         |
| `edit`        | Find-and-replace edit | `filePath, oldString, newString, replaceAll?`                   | Same                                                                                                   |
| `apply_patch` | Apply a patch         | `filePath, patch`                                               | **OpenAI-family models only, and must be explicitly enabled**                                          |
| `exec`        | Run a command         | `command, host?, security?, ask?, workdir?, timeout?, yieldMs?` | OpenClaw's own; **pi's `bash` is removed outright**                                                    |
| `process`     | Process management    | `action(list/poll/log/write/kill), id?`                         | Takes over processes backgrounded by `exec`                                                            |

> `exec`'s three orthogonal dimensions (host / security / ask) and its two-phase approval protocol are covered in §22.5.2. **The process registry is isolated by sessionKey**, so one session can't see or kill another's processes.

## C.2 Sessions and Subagents

| Tool               | Purpose                               | Key parameters                                       |
| ------------------ | ------------------------------------- | ---------------------------------------------------- |
| `sessions_spawn`   | Spawn a subagent / ACP agent          | `task, runtime?, agentId?, model?, label?, cleanup?` |
| `sessions_list`    | List sessions                         | `limit?`                                             |
| `sessions_history` | View session history                  | `sessionKey, limit?`                                 |
| `sessions_send`    | Send to a session (incl. A2A variant) | `sessionKey, message`                                |
| `session_status`   | Current session status                | —                                                    |
| `subagents`        | List / terminate subagents            | `action, id?`                                        |
| `agents_list`      | List configured agents                | —                                                    |

Visibility is constrained by the policy in `sessions-access.ts`. Subagent depth limits and push-mode notification are covered in §39.4.

## C.3 Memory

| Tool            | Purpose                          | Key parameters               |
| --------------- | -------------------------------- | ---------------------------- |
| `memory_search` | Hybrid retrieval (vector + BM25) | `query, limit?`              |
| `memory_get`    | Read exact lines by path         | `path, startLine?, endLine?` |

> **Note it is `memory_get`, not `memory_save`.** OpenClaw has **no dedicated memory-write tool** — writing memory goes through the ordinary `write` tool, editing Markdown directly (the "files as source of truth" theme, §44.3).
>
> Both tools are registered by a memory-class plugin (`memory-core` by default); `plugins.slots.memory = "none"` disables them entirely. Security boundary: `memory_get` may only read paths under `MEMORY.md` and `memory/`. See Chapter 28.

## C.4 Peripherals and Multimedia

| Tool      | Purpose          | Key parameters                                                     |
| --------- | ---------------- | ------------------------------------------------------------------ |
| `browser` | Browser control  | `action(snapshot/act/screenshot/tabs/pdf...), ref?, url?, fields?` |
| `canvas`  | A2UI canvas      | `action(present/hide/navigate/eval/snapshot), html?, js?`          |
| `image`   | Image processing | `action, path?, url?`                                              |
| `pdf`     | PDF processing   | `action, path?`                                                    |
| `tts`     | Text to speech   | `text, provider?`                                                  |

`browser`'s core actions are `snapshot` (**an accessibility text tree, not a screenshot**) plus `act` (referencing nodes by the `ref` values the snapshot returned) — semantics before pixels, an order of magnitude better on token efficiency (§24.5.3).

**`tts` is hard-disabled on voice channels** (speech-to-speech-to-speech is a loop).

## C.5 Web

| Tool         | Purpose                                                                                         |
| ------------ | ----------------------------------------------------------------------------------------------- |
| `web_search` | Web search (**disabled under xAI models**, conflicting with their native tool of the same name) |
| `web_fetch`  | Fetch a page, with SSRF protection and visibility filtering via `web-guarded-fetch.ts`          |

## C.6 Messaging and Channel Actions

| Tool                                                                              | Purpose                                                                                                           |
| --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `message`                                                                         | **The unified cross-channel send entry point** (792 lines), supporting sendMessage / threadReply / react and more |
| `react` / `poll` / `reminder` / `alerts` / `member` / `role` / `edited` / `media` | Channel-specific action tools, registered dynamically per platform capability                                     |

Channel capabilities (can it post polls? can it pin?) are **declared to the model in the system prompt** by `channel-tools.ts` rather than discovered by trial and error.

> Earlier editions called these platform-named tools like `telegram` / `discord`. The current implementation is **named by action and filtered by channel capability**.

## C.7 System

| Tool      | Purpose                                                                                       |
| --------- | --------------------------------------------------------------------------------------------- |
| `cron`    | Scheduled job management                                                                      |
| `nodes`   | Remote node control                                                                           |
| `gateway` | **The bridge letting the agent call internal Gateway RPCs** — `exec` approval goes through it |

## C.8 How the Tool Set Gets Trimmed

A run's actual tool set = the superset filtered through **seven policy layers** (`applyToolPolicyPipeline`, `pi-tools.ts:568-588`):

```
1. profile policy
2. provider profile
3. global policy
4. agent policy
5. group policy
6. sandbox tool policy
7. subagent tool policy
```

**Any layer can remove a tool.** Plus several hard rules:

* voice channels ban `tts`;
* xAI bans the built-in `web_search`;
* **non-owner senders lose owner-only tools** — the original comment: **"unknown/undefined is always treated as unauthorized; opt-in, not opt-out."**

### On sandbox policy

Sandbox sessions are trimmed by `sandbox-tool-policy.ts` (layer six), typically **removing host browser control while keeping the in-container one**.

**There is no hard-coded "sandbox default list"** — the allow/deny outcome depends on the combination of `agents.defaults.sandbox.*` and the tool policies at each level. To see what a particular run actually received, use the **system-prompt bill** described in §15.5.4 (`/context list` / `/context detail`).

## C.9 A Practical Reminder: Tool Schemas Are the Top Context Expense

Tool schemas routinely run 30,000 characters (\~8k tokens). That's why:

* the tool set is trimmed per scenario (seven layers);
* plugin tools marked `optional: true` stay out of the set by default (§21.5.5);
* the system-prompt report breaks out schema size as its own line item (§15.5.4).

**Reducing tool count is the most direct context optimization available** — considerably more effective than tuning `maxTokens`.

***

> Full JSON Schema definitions live in the files under `src/agents/tools/`; the assembly line is `createOpenClawCodingTools()` at `src/agents/pi-tools.ts:198`.

## Appendix Summary

1. **The tool set isn't fixed** — it's generated per run through seven policy layers; this table is the superset.
2. **`memory_get`, not `memory_save`**: OpenClaw has no dedicated memory-write tool; writing memory goes through ordinary `write` on Markdown.
3. **pi's `bash` is removed outright**, replaced by OpenClaw's own `exec` + `process`.
4. Channel action tools are **named by action and filtered by capability**, not named by platform.
5. **Reducing tool count is the most direct context optimization** — schemas are the top expense in the context budget.
