2025-12-22 23:40:57 +00:00
---
2026-01-30 03:15:10 +01:00
summary: "Agent tool surface for OpenClaw (browser, canvas, nodes, message, cron) replacing legacy `openclaw-*` skills"
2025-12-22 23:40:57 +00:00
read_when:
- Adding or modifying agent tools
2026-01-30 03:15:10 +01:00
- Retiring or changing `openclaw-*` skills
2026-01-31 16:04:03 -05:00
title: "Tools"
2025-12-22 23:40:57 +00:00
---
2026-01-30 03:15:10 +01:00
# Tools (OpenClaw)
2025-12-22 23:40:57 +00:00
2026-01-30 03:15:10 +01:00
OpenClaw exposes **first-class agent tools** for browser, canvas, nodes, and cron.
These replace the old `openclaw-*` skills: the tools are typed, no shelling,
2025-12-22 23:40:57 +00:00
and the agent should rely on them directly.
2026-01-05 00:05:21 +01:00
## Disabling tools
2026-01-30 03:15:10 +01:00
You can globally allow/deny tools via `tools.allow` / `tools.deny` in `openclaw.json`
2026-01-13 07:15:57 +00:00
(deny wins). This prevents disallowed tools from being sent to model providers.
2026-01-05 00:05:21 +01:00
```json5
{
2026-01-31 21:13:13 +09:00
tools: { deny: ["browser"] },
2026-01-05 00:05:21 +01:00
}
```
2026-01-24 01:15:49 +00:00
Notes:
2026-01-31 21:13:13 +09:00
2026-01-24 01:15:49 +00:00
- Matching is case-insensitive.
- `*` wildcards are supported (`"*"` means all tools).
2026-01-30 03:15:10 +01:00
- If `tools.allow` only references unknown or unloaded plugin tool names, OpenClaw logs a warning and ignores the allowlist so core tools stay available.
2026-01-24 01:15:49 +00:00
2026-01-13 06:28:15 +00:00
## Tool profiles (base allowlist)
`tools.profile` sets a **base tool allowlist** before `tools.allow` /`tools.deny` .
Per-agent override: `agents.list[].tools.profile` .
Profiles:
2026-01-31 21:13:13 +09:00
2026-01-13 06:28:15 +00:00
- `minimal` : `session_status` only
- `coding` : `group:fs` , `group:runtime` , `group:sessions` , `group:memory` , `image`
- `messaging` : `group:messaging` , `sessions_list` , `sessions_history` , `sessions_send` , `session_status`
- `full` : no restriction (same as unset)
Example (messaging-only by default, allow Slack + Discord tools too):
2026-01-31 21:13:13 +09:00
2026-01-13 06:28:15 +00:00
```json5
{
tools: {
profile: "messaging",
2026-01-31 21:13:13 +09:00
allow: ["slack", "discord"],
},
2026-01-13 06:28:15 +00:00
}
```
Example (coding profile, but deny exec/process everywhere):
2026-01-31 21:13:13 +09:00
2026-01-13 06:28:15 +00:00
```json5
{
tools: {
profile: "coding",
2026-01-31 21:13:13 +09:00
deny: ["group:runtime"],
},
2026-01-13 06:28:15 +00:00
}
```
Example (global coding profile, messaging-only support agent):
2026-01-31 21:13:13 +09:00
2026-01-13 06:28:15 +00:00
```json5
{
tools: { profile: "coding" },
agents: {
list: [
{
id: "support",
2026-01-31 21:13:13 +09:00
tools: { profile: "messaging", allow: ["slack"] },
},
],
},
2026-01-13 06:28:15 +00:00
}
```
2026-01-13 09:59:36 +00:00
## Provider-specific tool policy
Use `tools.byProvider` to **further restrict** tools for specific providers
(or a single `provider/model` ) without changing your global defaults.
Per-agent override: `agents.list[].tools.byProvider` .
This is applied **after** the base tool profile and **before** allow/deny lists,
so it can only narrow the tool set.
Provider keys accept either `provider` (e.g. `google-antigravity` ) or
`provider/model` (e.g. `openai/gpt-5.2` ).
Example (keep global coding profile, but minimal tools for Google Antigravity):
2026-01-31 21:13:13 +09:00
2026-01-13 09:59:36 +00:00
```json5
{
tools: {
profile: "coding",
byProvider: {
2026-01-31 21:13:13 +09:00
"google-antigravity": { profile: "minimal" },
},
},
2026-01-13 09:59:36 +00:00
}
```
Example (provider/model-specific allowlist for a flaky endpoint):
2026-01-31 21:13:13 +09:00
2026-01-13 09:59:36 +00:00
```json5
{
tools: {
allow: ["group:fs", "group:runtime", "sessions_list"],
byProvider: {
2026-01-31 21:13:13 +09:00
"openai/gpt-5.2": { allow: ["group:fs", "sessions_list"] },
},
},
2026-01-13 09:59:36 +00:00
}
```
Example (agent-specific override for a single provider):
2026-01-31 21:13:13 +09:00
2026-01-13 09:59:36 +00:00
```json5
{
agents: {
list: [
{
id: "support",
tools: {
byProvider: {
2026-01-31 21:13:13 +09:00
"google-antigravity": { allow: ["message", "sessions_list"] },
},
},
},
],
},
2026-01-13 09:59:36 +00:00
}
```
2026-01-13 06:28:15 +00:00
## Tool groups (shorthands)
Tool policies (global, agent, sandbox) support `group:*` entries that expand to multiple tools.
Use these in `tools.allow` / `tools.deny` .
Available groups:
2026-01-31 21:13:13 +09:00
2026-01-13 06:28:15 +00:00
- `group:runtime` : `exec` , `bash` , `process`
- `group:fs` : `read` , `write` , `edit` , `apply_patch`
- `group:sessions` : `sessions_list` , `sessions_history` , `sessions_send` , `sessions_spawn` , `session_status`
- `group:memory` : `memory_search` , `memory_get`
2026-01-15 04:07:29 +00:00
- `group:web` : `web_search` , `web_fetch`
2026-01-13 06:28:15 +00:00
- `group:ui` : `browser` , `canvas`
- `group:automation` : `cron` , `gateway`
- `group:messaging` : `message`
- `group:nodes` : `nodes`
2026-01-30 03:15:10 +01:00
- `group:openclaw` : all built-in OpenClaw tools (excludes provider plugins)
2026-01-13 06:28:15 +00:00
Example (allow only file tools + browser):
2026-01-31 21:13:13 +09:00
2026-01-13 06:28:15 +00:00
```json5
{
tools: {
2026-01-31 21:13:13 +09:00
allow: ["group:fs", "browser"],
},
2026-01-13 06:28:15 +00:00
}
```
2026-01-11 12:11:12 +00:00
## Plugins + tools
Plugins can register **additional tools** (and CLI commands) beyond the core set.
2026-02-07 15:40:35 -05:00
See [Plugins ](/tools/plugin ) for install + config, and [Skills ](/tools/skills ) for how
2026-01-11 12:11:12 +00:00
tool usage guidance is injected into prompts. Some plugins ship their own skills
alongside tools (for example, the voice-call plugin).
2026-01-22 03:25:13 +00:00
Optional plugin tools:
2026-01-31 21:13:13 +09:00
2026-01-23 02:51:20 +00:00
- [Lobster ](/tools/lobster ): typed workflow runtime with resumable approvals (requires the Lobster CLI on the gateway host).
2026-01-24 01:44:36 +00:00
- [LLM Task ](/tools/llm-task ): JSON-only LLM step for structured workflow output (optional schema validation).
2026-03-02 04:38:50 -05:00
- [Diffs ](/tools/diffs ): read-only diff viewer and PNG or PDF file renderer for before/after text or unified patches.
2026-01-22 03:25:13 +00:00
2025-12-22 23:40:57 +00:00
## Tool inventory
2026-01-12 03:42:49 +00:00
### `apply_patch`
2026-01-31 21:13:13 +09:00
2026-01-12 03:42:49 +00:00
Apply structured patches across one or more files. Use for multi-hunk edits.
Experimental: enable via `tools.exec.applyPatch.enabled` (OpenAI models only).
2026-02-15 01:21:07 +01:00
`tools.exec.applyPatch.workspaceOnly` defaults to `true` (workspace-contained). Set it to `false` only if you intentionally want `apply_patch` to write/delete outside the workspace directory.
2026-01-12 03:42:49 +00:00
2026-01-12 02:49:55 +00:00
### `exec`
2026-01-31 21:13:13 +09:00
2025-12-25 00:25:11 +00:00
Run shell commands in the workspace.
Core parameters:
2026-01-31 21:13:13 +09:00
2025-12-25 00:25:11 +00:00
- `command` (required)
2026-01-03 20:15:02 +00:00
- `yieldMs` (auto-background after timeout, default 10000)
2025-12-25 00:25:11 +00:00
- `background` (immediate background)
2025-12-25 17:58:19 +00:00
- `timeout` (seconds; kills the process if exceeded, default 1800)
2026-01-08 23:17:02 +01:00
- `elevated` (bool; run on host if elevated mode is enabled/allowed; only changes behavior when the agent is sandboxed)
2026-01-18 04:27:33 +00:00
- `host` (`sandbox | gateway | node` )
- `security` (`deny | allowlist | full` )
- `ask` (`off | on-miss | always` )
- `node` (node id/name for `host=node` )
2026-01-17 04:57:04 +00:00
- Need a real TTY? Set `pty: true` .
2025-12-25 00:25:11 +00:00
Notes:
2026-01-31 21:13:13 +09:00
2025-12-25 00:25:11 +00:00
- Returns `status: "running"` with a `sessionId` when backgrounded.
- Use `process` to poll/log/write/kill/clear background sessions.
2026-01-12 02:49:55 +00:00
- If `process` is disallowed, `exec` runs synchronously and ignores `yieldMs` /`background` .
2026-01-18 04:27:33 +00:00
- `elevated` is gated by `tools.elevated` plus any `agents.list[].tools.elevated` override (both must allow) and is an alias for `host=gateway` + `security=full` .
2026-01-08 23:18:09 +01:00
- `elevated` only changes behavior when the agent is sandboxed (otherwise it’ s a no-op).
2026-01-30 03:15:10 +01:00
- `host=node` can target a macOS companion app or a headless node host (`openclaw node run` ).
2026-01-18 04:27:33 +00:00
- gateway/node approvals and allowlists: [Exec approvals ](/tools/exec-approvals ).
2025-12-25 00:25:11 +00:00
### `process`
2026-01-31 21:13:13 +09:00
2026-01-12 02:49:55 +00:00
Manage background exec sessions.
2025-12-25 00:25:11 +00:00
Core actions:
2026-01-31 21:13:13 +09:00
2025-12-25 00:25:11 +00:00
- `list` , `poll` , `log` , `write` , `kill` , `clear` , `remove`
Notes:
2026-01-31 21:13:13 +09:00
2025-12-25 00:25:11 +00:00
- `poll` returns new output and exit status when complete.
2025-12-25 17:58:19 +00:00
- `log` supports line-based `offset` /`limit` (omit `offset` to grab the last N lines).
2026-01-07 23:35:04 +01:00
- `process` is scoped per agent; sessions from other agents are not visible.
2025-12-25 00:25:11 +00:00
2026-02-17 00:17:01 +01:00
### `loop-detection` (tool-call loop guardrails)
OpenClaw tracks recent tool-call history and blocks or warns when it detects repetitive no-progress loops.
Enable with `tools.loopDetection.enabled: true` (default is `false` ).
```json5
{
tools: {
loopDetection: {
enabled: true,
warningThreshold: 10,
criticalThreshold: 20,
globalCircuitBreakerThreshold: 30,
historySize: 30,
detectors: {
genericRepeat: true,
knownPollNoProgress: true,
pingPong: true,
},
},
},
}
```
- `genericRepeat` : repeated same tool + same params call pattern.
- `knownPollNoProgress` : repeating poll-like tools with identical outputs.
- `pingPong` : alternating `A/B/A/B` no-progress patterns.
- Per-agent override: `agents.list[].tools.loopDetection` .
2026-01-15 04:07:29 +00:00
### `web_search`
2026-01-31 21:13:13 +09:00
2026-03-06 19:09:00 +00:00
Search the web using Perplexity, Brave, Gemini, Grok, or Kimi.
2026-01-15 04:07:29 +00:00
Core parameters:
2026-01-31 21:13:13 +09:00
2026-01-15 04:07:29 +00:00
- `query` (required)
- `count` (1– 10; default from `tools.web.search.maxResults` )
Notes:
2026-01-31 21:13:13 +09:00
2026-03-06 19:09:00 +00:00
- Requires an API key for the chosen provider (recommended: `openclaw configure --section web` ).
2026-01-15 04:07:29 +00:00
- Enable via `tools.web.search.enabled` .
- Responses are cached (default 15 min).
- See [Web tools ](/tools/web ) for setup.
### `web_fetch`
2026-01-31 21:13:13 +09:00
2026-01-15 04:07:29 +00:00
Fetch and extract readable content from a URL (HTML → markdown/text).
Core parameters:
2026-01-31 21:13:13 +09:00
2026-01-15 04:07:29 +00:00
- `url` (required)
- `extractMode` (`markdown` | `text` )
- `maxChars` (truncate long pages)
Notes:
2026-01-31 21:13:13 +09:00
2026-01-15 04:07:29 +00:00
- Enable via `tools.web.fetch.enabled` .
2026-02-03 17:35:51 -08:00
- `maxChars` is clamped by `tools.web.fetch.maxCharsCap` (default 50000).
2026-01-15 04:07:29 +00:00
- Responses are cached (default 15 min).
- For JS-heavy sites, prefer the browser tool.
- See [Web tools ](/tools/web ) for setup.
2026-01-17 00:00:15 +00:00
- See [Firecrawl ](/tools/firecrawl ) for the optional anti-bot fallback.
2026-01-15 04:07:29 +00:00
2026-01-03 12:39:52 +01:00
### `browser`
2026-01-31 21:13:13 +09:00
2026-01-30 03:15:10 +01:00
Control the dedicated OpenClaw-managed browser.
2025-12-22 23:40:57 +00:00
Core actions:
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- `status` , `start` , `stop` , `tabs` , `open` , `focus` , `close`
- `snapshot` (aria/ai)
- `screenshot` (returns image block + `MEDIA:<path>` )
- `act` (UI actions: click/type/press/hover/drag/select/fill/resize/wait/evaluate)
- `navigate` , `console` , `pdf` , `upload` , `dialog`
2026-01-04 03:32:40 +00:00
Profile management:
2026-01-31 21:13:13 +09:00
2026-01-04 03:32:40 +00:00
- `profiles` — list all browser profiles with status
- `create-profile` — create new profile with auto-allocated port (or `cdpUrl` )
- `delete-profile` — stop browser, delete user data, remove from config (local only)
- `reset-profile` — kill orphan process on profile's port (local only)
Common parameters:
2026-01-31 21:13:13 +09:00
2026-01-04 03:32:40 +00:00
- `profile` (optional; defaults to `browser.defaultProfile` )
2026-01-27 03:23:42 +00:00
- `target` (`sandbox` | `host` | `node` )
- `node` (optional; picks a specific node id/name)
2026-01-31 21:13:13 +09:00
Notes:
2026-01-05 22:17:14 +01:00
- Requires `browser.enabled=true` (default is `true` ; set `false` to disable).
2026-01-04 03:32:40 +00:00
- All actions accept optional `profile` parameter for multi-instance support.
2026-01-15 08:50:08 +00:00
- When `profile` is omitted, uses `browser.defaultProfile` (defaults to "chrome").
2026-01-04 03:32:40 +00:00
- Profile names: lowercase alphanumeric + hyphens only (max 64 chars).
- Port range: 18800-18899 (~100 profiles max).
- Remote profiles are attach-only (no start/stop/reset).
2026-01-27 03:23:42 +00:00
- If a browser-capable node is connected, the tool may auto-route to it (unless you pin `target` ).
2026-01-12 08:36:23 +00:00
- `snapshot` defaults to `ai` when Playwright is installed; use `aria` for the accessibility tree.
- `snapshot` also supports role-snapshot options (`interactive` , `compact` , `depth` , `selector` ) which return refs like `e12` .
- `act` requires `ref` from `snapshot` (numeric `12` from AI snapshots, or `e12` from role snapshots); use `evaluate` for rare CSS selector needs.
2025-12-30 19:22:38 +00:00
- Avoid `act` → `wait` by default; use it only in exceptional cases (no reliable UI state to wait on).
2026-01-01 09:35:20 +00:00
- `upload` can optionally pass a `ref` to auto-click after arming.
2026-01-01 09:44:29 +00:00
- `upload` also supports `inputRef` (aria ref) or `element` (CSS selector) to set `<input type="file">` directly.
2025-12-22 23:40:57 +00:00
2026-01-03 12:39:52 +01:00
### `canvas`
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
Drive the node Canvas (present, eval, snapshot, A2UI).
Core actions:
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- `present` , `hide` , `navigate` , `eval`
- `snapshot` (returns image block + `MEDIA:<path>` )
- `a2ui_push` , `a2ui_reset`
Notes:
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- Uses gateway `node.invoke` under the hood.
- If no `node` is provided, the tool picks a default (single connected node or local mac node).
2025-12-27 01:36:24 +01:00
- A2UI is v0.8 only (no `createSurface` ); the CLI rejects v0.9 JSONL with line errors.
2026-01-30 03:15:10 +01:00
- Quick smoke: `openclaw nodes canvas a2ui push --node <id> --text "Hello from A2UI"` .
2025-12-22 23:40:57 +00:00
2026-01-03 12:39:52 +01:00
### `nodes`
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
Discover and target paired nodes; send notifications; capture camera/screen.
Core actions:
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- `status` , `describe`
- `pending` , `approve` , `reject` (pairing)
- `notify` (macOS `system.notify` )
2026-01-08 00:17:44 +00:00
- `run` (macOS `system.run` )
2026-02-27 09:25:08 +05:30
- `camera_list` , `camera_snap` , `camera_clip` , `screen_record`
2026-02-27 09:40:32 +05:30
- `location_get` , `notifications_list` , `notifications_action`
- `device_status` , `device_info` , `device_permissions` , `device_health`
2025-12-22 23:40:57 +00:00
Notes:
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- Camera/screen commands require the node app to be foregrounded.
- Images return image blocks + `MEDIA:<path>` .
- Videos return `FILE:<path>` (mp4).
2026-01-04 00:54:44 +01:00
- Location returns a JSON payload (lat/lon/accuracy/timestamp).
2026-01-08 00:24:11 +00:00
- `run` params: `command` argv array; optional `cwd` , `env` (`KEY=VAL` ), `commandTimeoutMs` , `invokeTimeoutMs` , `needsScreenRecording` .
Example (`run` ):
2026-01-31 21:13:13 +09:00
2026-01-08 00:24:11 +00:00
```json
{
"action": "run",
"node": "office-mac",
"command": ["echo", "Hello"],
"env": ["FOO=bar"],
"commandTimeoutMs": 12000,
"invokeTimeoutMs": 45000,
"needsScreenRecording": false
}
```
2025-12-22 23:40:57 +00:00
2026-01-04 19:35:00 +01:00
### `image`
2026-01-31 21:13:13 +09:00
2026-01-04 19:35:00 +01:00
Analyze an image with the configured image model.
Core parameters:
2026-01-31 21:13:13 +09:00
2026-01-04 19:35:00 +01:00
- `image` (required path or URL)
- `prompt` (optional; defaults to "Describe the image.")
- `model` (optional override)
- `maxBytesMb` (optional size cap)
Notes:
2026-01-31 21:13:13 +09:00
2026-01-12 17:50:44 +00:00
- Only available when `agents.defaults.imageModel` is configured (primary or fallbacks), or when an implicit image model can be inferred from your default model + configured auth (best-effort pairing).
2026-01-04 19:35:00 +01:00
- Uses the image model directly (independent of the main chat model).
feat: add PDF analysis tool with native provider support (#31319)
* feat: add PDF analysis tool with native provider support
New `pdf` tool for analyzing PDF documents with model-powered analysis.
Architecture:
- Native PDF path: sends raw PDF bytes directly to providers that support
inline document input (Anthropic via DocumentBlockParam, Google Gemini
via inlineData with application/pdf MIME type)
- Extraction fallback: for providers without native PDF support, extracts
text via pdfjs-dist and rasterizes pages to images via @napi-rs/canvas,
then sends through the standard vision/text completion path
Key features:
- Single PDF (`pdf` param) or multiple PDFs (`pdfs` array, up to 10)
- Page range selection (`pages` param, e.g. "1-5", "1,3,7-9")
- Model override (`model` param) and file size limits (`maxBytesMb`)
- Auto-detects provider capability and falls back gracefully
- Same security patterns as image tool (SSRF guards, sandbox support,
local path roots, workspace-only policy)
Config (agents.defaults):
- pdfModel: primary/fallbacks (defaults to imageModel, then session model)
- pdfMaxBytesMb: max PDF file size (default: 10)
- pdfMaxPages: max pages to process (default: 20)
Model catalog:
- Extended ModelInputType to include "document" alongside "text"/"image"
- Added modelSupportsDocument() capability check
Files:
- src/agents/tools/pdf-tool.ts - main tool factory
- src/agents/tools/pdf-tool.helpers.ts - helpers (page range, config, etc.)
- src/agents/tools/pdf-native-providers.ts - direct API calls for Anthropic/Google
- src/agents/tools/pdf-tool.test.ts - 43 tests covering all paths
- Modified: model-catalog.ts, openclaw-tools.ts, config schema/types/labels/help
* fix: prepare pdf tool for merge (#31319) (thanks @tyler6204)
2026-03-01 22:39:12 -08:00
### `pdf`
Analyze one or more PDF documents.
2026-03-03 04:07:00 +00:00
For full behavior, limits, config, and examples, see [PDF tool ](/tools/pdf ).
feat: add PDF analysis tool with native provider support (#31319)
* feat: add PDF analysis tool with native provider support
New `pdf` tool for analyzing PDF documents with model-powered analysis.
Architecture:
- Native PDF path: sends raw PDF bytes directly to providers that support
inline document input (Anthropic via DocumentBlockParam, Google Gemini
via inlineData with application/pdf MIME type)
- Extraction fallback: for providers without native PDF support, extracts
text via pdfjs-dist and rasterizes pages to images via @napi-rs/canvas,
then sends through the standard vision/text completion path
Key features:
- Single PDF (`pdf` param) or multiple PDFs (`pdfs` array, up to 10)
- Page range selection (`pages` param, e.g. "1-5", "1,3,7-9")
- Model override (`model` param) and file size limits (`maxBytesMb`)
- Auto-detects provider capability and falls back gracefully
- Same security patterns as image tool (SSRF guards, sandbox support,
local path roots, workspace-only policy)
Config (agents.defaults):
- pdfModel: primary/fallbacks (defaults to imageModel, then session model)
- pdfMaxBytesMb: max PDF file size (default: 10)
- pdfMaxPages: max pages to process (default: 20)
Model catalog:
- Extended ModelInputType to include "document" alongside "text"/"image"
- Added modelSupportsDocument() capability check
Files:
- src/agents/tools/pdf-tool.ts - main tool factory
- src/agents/tools/pdf-tool.helpers.ts - helpers (page range, config, etc.)
- src/agents/tools/pdf-native-providers.ts - direct API calls for Anthropic/Google
- src/agents/tools/pdf-tool.test.ts - 43 tests covering all paths
- Modified: model-catalog.ts, openclaw-tools.ts, config schema/types/labels/help
* fix: prepare pdf tool for merge (#31319) (thanks @tyler6204)
2026-03-01 22:39:12 -08:00
2026-01-09 06:43:40 +01:00
### `message`
2026-01-31 21:13:13 +09:00
2026-01-23 16:45:37 -06:00
Send messages and channel actions across Discord/Google Chat/Slack/Telegram/WhatsApp/Signal/iMessage/MS Teams.
2026-01-09 06:43:40 +01:00
Core actions:
2026-01-31 21:13:13 +09:00
2026-01-22 03:27:26 +00:00
- `send` (text + optional media; MS Teams also supports `card` for Adaptive Cards)
2026-01-11 02:24:35 +00:00
- `poll` (WhatsApp/Discord/MS Teams polls)
2026-01-09 08:27:17 +01:00
- `react` / `reactions` / `read` / `edit` / `delete`
- `pin` / `unpin` / `list-pins`
- `permissions`
- `thread-create` / `thread-list` / `thread-reply`
- `search`
- `sticker`
- `member-info` / `role-info`
- `emoji-list` / `emoji-upload` / `sticker-upload`
- `role-add` / `role-remove`
- `channel-info` / `channel-list`
- `voice-status`
- `event-list` / `event-create`
- `timeout` / `kick` / `ban`
2026-01-09 06:43:40 +01:00
Notes:
2026-01-31 21:13:13 +09:00
2026-01-13 07:15:57 +00:00
- `send` routes WhatsApp via the Gateway; other channels go direct.
2026-01-11 02:24:35 +00:00
- `poll` uses the Gateway for WhatsApp and MS Teams; Discord polls go direct.
2026-01-13 01:03:23 +00:00
- When a message tool call is bound to an active chat session, sends are constrained to that session’ s target to avoid cross-context leaks.
2026-01-09 06:43:40 +01:00
2026-01-03 12:39:52 +01:00
### `cron`
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
Manage Gateway cron jobs and wakeups.
Core actions:
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- `status` , `list`
- `add` , `update` , `remove` , `run` , `runs`
- `wake` (enqueue system event + optional immediate heartbeat)
Notes:
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- `add` expects a full cron job object (same schema as `cron.add` RPC).
2026-02-08 11:08:41 +08:00
- `update` uses `{ jobId, patch }` (`id` accepted for compatibility).
2025-12-22 23:40:57 +00:00
2026-01-03 12:39:52 +01:00
### `gateway`
2026-01-31 21:13:13 +09:00
2026-01-08 01:29:56 +01:00
Restart or apply updates to the running Gateway process (in-place).
2025-12-25 17:58:19 +00:00
Core actions:
2026-01-31 21:13:13 +09:00
2026-01-30 03:15:10 +01:00
- `restart` (authorizes + sends `SIGUSR1` for in-process restart; `openclaw gateway` restart in-place)
2026-03-06 02:50:48 -05:00
- `config.schema.lookup` (inspect one config path at a time without loading the full schema into prompt context)
2026-03-06 13:53:08 +09:00
- `config.get`
2026-01-08 01:29:56 +01:00
- `config.apply` (validate + write config + restart + wake)
2026-01-24 23:33:13 +00:00
- `config.patch` (merge partial update + restart + wake)
2026-01-08 01:29:56 +01:00
- `update.run` (run update + restart + wake)
2025-12-25 17:58:19 +00:00
Notes:
2026-01-31 21:13:13 +09:00
2026-03-06 08:52:42 -05:00
- `config.schema.lookup` expects a targeted config path such as `gateway.auth` or `agents.list.*.heartbeat` .
- Paths may include slash-delimited plugin ids when addressing `plugins.entries.<id>` , for example `plugins.entries.pack/one.config` .
2025-12-25 17:58:19 +00:00
- Use `delayMs` (defaults to 2000) to avoid interrupting an in-flight reply.
2026-03-06 13:53:08 +09:00
- `config.schema` remains available to internal Control UI flows and is not exposed through the agent `gateway` tool.
2026-02-19 10:00:27 +01:00
- `restart` is enabled by default; set `commands.restart: false` to disable it.
2025-12-25 17:58:19 +00:00
2026-01-09 23:35:35 +00:00
### `sessions_list` / `sessions_history` / `sessions_send` / `sessions_spawn` / `session_status`
2026-01-31 21:13:13 +09:00
2026-01-03 23:44:38 +01:00
List sessions, inspect transcript history, or send to another session.
Core parameters:
2026-01-31 21:13:13 +09:00
2026-01-03 23:44:38 +01:00
- `sessions_list` : `kinds?` , `limit?` , `activeMinutes?` , `messageLimit?` (0 = none)
2026-01-24 11:09:06 +00:00
- `sessions_history` : `sessionKey` (or `sessionId` ), `limit?` , `includeTools?`
- `sessions_send` : `sessionKey` (or `sessionId` ), `message` , `timeoutSeconds?` (0 = fire-and-forget)
2026-03-04 11:44:20 +01:00
- `sessions_spawn` : `task` , `label?` , `runtime?` , `agentId?` , `model?` , `thinking?` , `cwd?` , `runTimeoutSeconds?` , `thread?` , `mode?` , `cleanup?` , `sandbox?` , `streamTo?` , `attachments?` , `attachAs?`
2026-01-24 11:09:06 +00:00
- `session_status` : `sessionKey?` (default current; accepts `sessionId` ), `model?` (`default` clears override)
2026-01-03 23:44:38 +01:00
Notes:
2026-01-31 21:13:13 +09:00
2026-01-03 23:44:38 +01:00
- `main` is the canonical direct-chat key; global/unknown are hidden.
- `messageLimit > 0` fetches last N messages per session (tool messages filtered).
2026-02-16 03:43:51 +01:00
- Session targeting is controlled by `tools.sessions.visibility` (default `tree` : current session + spawned subagent sessions). If you run a shared agent for multiple users, consider setting `tools.sessions.visibility: "self"` to prevent cross-session browsing.
2026-01-03 23:44:38 +01:00
- `sessions_send` waits for final completion when `timeoutSeconds > 0` .
2026-01-10 00:32:20 +01:00
- Delivery/announce happens after completion and is best-effort; `status: "ok"` confirms the agent run finished, not that the announce was delivered.
2026-02-26 11:00:09 +01:00
- `sessions_spawn` supports `runtime: "subagent" | "acp"` (`subagent` default). For ACP runtime behavior, see [ACP Agents ](/tools/acp-agents ).
2026-03-04 11:44:20 +01:00
- For ACP runtime, `streamTo: "parent"` routes initial-run progress summaries back to the requester session as system events instead of direct child delivery.
2026-01-07 06:53:01 +01:00
- `sessions_spawn` starts a sub-agent run and posts an announce reply back to the requester chat.
2026-02-21 19:59:50 +01:00
- Supports one-shot mode (`mode: "run"` ) and persistent thread-bound mode (`mode: "session"` with `thread: true` ).
- If `thread: true` and `mode` is omitted, mode defaults to `session` .
- `mode: "session"` requires `thread: true` .
2026-02-24 04:22:25 +00:00
- If `runTimeoutSeconds` is omitted, OpenClaw uses `agents.defaults.subagents.runTimeoutSeconds` when set; otherwise timeout defaults to `0` (no timeout).
2026-02-21 19:59:50 +01:00
- Discord thread-bound flows depend on `session.threadBindings.*` and `channels.discord.threadBindings.*` .
2026-02-18 02:52:23 +01:00
- Reply format includes `Status` , `Result` , and compact stats.
- `Result` is the assistant completion text; if missing, the latest `toolResult` is used as fallback.
2026-02-18 03:19:30 +01:00
- Manual completion-mode spawns send directly first, with queue fallback and retry on transient failures (`status: "ok"` means run finished, not that announce delivered).
sessions_spawn: inline attachments with redaction, lifecycle cleanup, and docs (#16761)
Add inline file attachment support for sessions_spawn (subagent runtime only):
- Schema: attachments[] (name, content, encoding, mimeType) and attachAs.mountPath hint
- Materialization: files written to .openclaw/attachments/<uuid>/ with manifest.json
- Validation: strict base64 decode, filename checks, size limits, duplicate detection
- Transcript redaction: sanitizeToolCallInputs redacts attachment content from persisted transcripts
- Lifecycle cleanup: safeRemoveAttachmentsDir with symlink-safe path containment check
- Config: tools.sessions_spawn.attachments (enabled, maxFiles, maxFileBytes, maxTotalBytes, retainOnSessionKeep)
- Registry: attachmentsDir/attachmentsRootDir/retainAttachmentsOnKeep on SubagentRunRecord
- ACP rejection: attachments rejected for runtime=acp with clear error message
- Docs: updated tools/index.md, concepts/session-tool.md, configuration-reference.md
- Tests: 85 new/updated tests across 5 test files
Fixes:
- Guard fs.rm in materialization catch block with try/catch (review concern #1)
- Remove unreachable fallback in safeRemoveAttachmentsDir (review concern #7)
- Move attachment cleanup out of retry path to avoid timing issues with announce loop
Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
Co-authored-by: napetrov <napetrov@users.noreply.github.com>
2026-03-01 21:33:51 -08:00
- `sessions_spawn` supports inline file attachments for subagent runtime only (ACP rejects them). Each attachment has `name` , `content` , and optional `encoding` (`utf8` or `base64` ) and `mimeType` . Files are materialized into the child workspace at `.openclaw/attachments/<uuid>/` with a `.manifest.json` metadata file. The tool returns a receipt with `count` , `totalBytes` , per file `sha256` , and `relDir` . Attachment content is automatically redacted from transcript persistence.
- Configure limits via `tools.sessions_spawn.attachments` (`enabled` , `maxTotalBytes` , `maxFiles` , `maxFileBytes` , `retainOnSessionKeep` ).
- `attachAs.mountPath` is a reserved hint for future mount implementations.
2026-01-07 16:14:25 +00:00
- `sessions_spawn` is non-blocking and returns `status: "accepted"` immediately.
2026-03-04 11:44:20 +01:00
- ACP `streamTo: "parent"` responses may include `streamLogPath` (session-scoped `*.acp-stream.jsonl` ) for tailing progress history.
2026-01-04 03:37:44 +01:00
- `sessions_send` runs a reply‑ back ping‑ pong (reply `REPLY_SKIP` to stop; max turns via `session.agentToAgent.maxPingPongTurns` , 0– 5).
- After the ping‑ pong, the target agent runs an **announce step** ; reply `ANNOUNCE_SKIP` to suppress the announcement.
2026-02-16 03:43:51 +01:00
- Sandbox clamp: when the current session is sandboxed and `agents.defaults.sandbox.sessionToolsVisibility: "spawned"` , OpenClaw clamps `tools.sessions.visibility` to `tree` .
2026-01-03 23:44:38 +01:00
2026-01-08 07:06:36 +00:00
### `agents_list`
2026-01-31 21:13:13 +09:00
2026-01-08 07:06:36 +00:00
List agent ids that the current session may target with `sessions_spawn` .
Notes:
2026-01-31 21:13:13 +09:00
2026-01-09 12:44:23 +00:00
- Result is restricted to per-agent allowlists (`agents.list[].subagents.allowAgents` ).
2026-01-08 07:06:36 +00:00
- When `["*"]` is configured, the tool includes all configured agents and marks `allowAny: true` .
2025-12-22 23:40:57 +00:00
## Parameters (common)
2026-01-03 12:39:52 +01:00
Gateway-backed tools (`canvas` , `nodes` , `cron` ):
2026-01-31 21:13:13 +09:00
2025-12-22 23:40:57 +00:00
- `gatewayUrl` (default `ws://127.0.0.1:18789` )
- `gatewayToken` (if auth enabled)
- `timeoutMs`
2026-02-04 18:59:44 -05:00
Note: when `gatewayUrl` is set, include `gatewayToken` explicitly. Tools do not inherit config
or environment credentials for overrides, and missing explicit credentials is an error.
2025-12-22 23:40:57 +00:00
Browser tool:
2026-01-31 21:13:13 +09:00
2026-01-27 03:23:42 +00:00
- `profile` (optional; defaults to `browser.defaultProfile` )
- `target` (`sandbox` | `host` | `node` )
- `node` (optional; pin a specific node id/name)
2026-03-08 19:19:14 +00:00
- Troubleshooting guides:
- Linux startup/CDP issues: [Browser troubleshooting (Linux) ](/tools/browser-linux-troubleshooting )
- WSL2 Gateway + Windows remote Chrome CDP: [WSL2 + Windows + remote Chrome CDP troubleshooting ](/tools/browser-wsl2-windows-remote-cdp-troubleshooting )
2025-12-22 23:40:57 +00:00
## Recommended agent flows
Browser automation:
2026-01-31 21:13:13 +09:00
1. `browser` → `status` / `start`
2. `snapshot` (ai or aria)
3. `act` (click/type/press)
4. `screenshot` if you need visual confirmation
2025-12-22 23:40:57 +00:00
Canvas render:
2026-01-31 21:13:13 +09:00
1. `canvas` → `present`
2. `a2ui_push` (optional)
3. `snapshot`
2025-12-22 23:40:57 +00:00
Node targeting:
2026-01-31 21:13:13 +09:00
1. `nodes` → `status`
2. `describe` on the chosen node
3. `notify` / `run` / `camera_snap` / `screen_record`
2025-12-22 23:40:57 +00:00
## Safety
2026-01-08 00:24:11 +00:00
- Avoid direct `system.run` ; use `nodes` → `run` only with explicit user consent.
2025-12-22 23:40:57 +00:00
- Respect user consent for camera/screen capture.
- Use `status/describe` to ensure permissions before invoking media commands.
2025-12-23 00:29:38 +00:00
2026-01-08 23:06:56 +01:00
## How tools are presented to the agent
Tools are exposed in two parallel channels:
2026-01-31 21:13:13 +09:00
1. **System prompt text** : a human-readable list + guidance.
2. **Tool schema** : the structured function definitions sent to the model API.
2026-01-08 23:06:56 +01:00
That means the agent sees both “what tools exist” and “how to call them.” If a tool
doesn’ t appear in the system prompt or the schema, the model cannot call it.