9.5 KiB
summary, read_when
| summary | read_when | ||
|---|---|---|---|
| Agent tool surface for Clawdbot (browser, canvas, nodes, cron) replacing clawdbot-* skills |
|
Tools (Clawdbot)
Clawdbot exposes first-class agent tools for browser, canvas, nodes, and cron.
These replace the old clawdbot-* skills: the tools are typed, no shelling,
and the agent should rely on them directly.
Tool inventory
bash
Run shell commands in the workspace.
Core parameters:
command(required)yieldMs(auto-background after timeout, default 10000)background(immediate background)timeout(seconds; kills the process if exceeded, default 1800)elevated(bool; run on host if elevated mode is enabled/allowed)- Need a real TTY? Use the tmux skill.
Notes:
- Returns
status: "running"with asessionIdwhen backgrounded. - Use
processto poll/log/write/kill/clear background sessions.
process
Manage background bash sessions.
Core actions:
list,poll,log,write,kill,clear,remove
Notes:
pollreturns new output and exit status when complete.logsupports line-basedoffset/limit(omitoffsetto grab the last N lines).
browser
Control the dedicated clawd browser.
Core actions:
status,start,stop,tabs,open,focus,closesnapshot(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
Profile management:
profiles— list all browser profiles with statuscreate-profile— create new profile with auto-allocated port (orcdpUrl)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:
controlUrl(defaults from config)profile(optional; defaults tobrowser.defaultProfile) Notes:- Requires
browser.enabled=truein~/.clawdbot/clawdbot.json. - Uses
browser.controlUrlunlesscontrolUrlis passed explicitly. - All actions accept optional
profileparameter for multi-instance support. - When
profileis omitted, usesbrowser.defaultProfile(defaults to "clawd"). - 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).
snapshotdefaults toai; useariafor the accessibility tree.actrequiresreffromsnapshot --format ai; useevaluatefor rare CSS selector needs.- Avoid
act→waitby default; use it only in exceptional cases (no reliable UI state to wait on). uploadcan optionally pass arefto auto-click after arming.uploadalso supportsinputRef(aria ref) orelement(CSS selector) to set<input type="file">directly.
canvas
Drive the node Canvas (present, eval, snapshot, A2UI).
Core actions:
present,hide,navigate,evalsnapshot(returns image block +MEDIA:<path>)a2ui_push,a2ui_reset
Notes:
- Uses gateway
node.invokeunder the hood. - If no
nodeis provided, the tool picks a default (single connected node or local mac node). - A2UI is v0.8 only (no
createSurface); the CLI rejects v0.9 JSONL with line errors. - Quick smoke:
clawdbot canvas a2ui push --text "Hello from A2UI".
nodes
Discover and target paired nodes; send notifications; capture camera/screen.
Core actions:
status,describepending,approve,reject(pairing)notify(macOSsystem.notify)camera_snap,camera_clip,screen_recordlocation_get
Notes:
- Camera/screen commands require the node app to be foregrounded.
- Images return image blocks +
MEDIA:<path>. - Videos return
FILE:<path>(mp4). - Location returns a JSON payload (lat/lon/accuracy/timestamp).
image
Analyze an image with the configured image model.
Core parameters:
image(required path or URL)prompt(optional; defaults to "Describe the image.")model(optional override)maxBytesMb(optional size cap)
Notes:
- Only available when
agent.imageModeloragent.imageModelFallbacksis set. - Uses the image model directly (independent of the main chat model).
cron
Manage Gateway cron jobs and wakeups.
Core actions:
status,listadd,update,remove,run,runswake(enqueue system event + optional immediate heartbeat)
Notes:
addexpects a full cron job object (same schema ascron.addRPC).updateuses{ jobId, patch }.
gateway
Restart the running Gateway process (in-place).
Core actions:
restart(sendsSIGUSR1to the current process;clawdbot gateway/gateway-daemonrestart in-place)
Notes:
- Use
delayMs(defaults to 2000) to avoid interrupting an in-flight reply.
sessions_list / sessions_history / sessions_send
List sessions, inspect transcript history, or send to another session.
Core parameters:
sessions_list:kinds?,limit?,activeMinutes?,messageLimit?(0 = none)sessions_history:sessionKey,limit?,includeTools?sessions_send:sessionKey,message,timeoutSeconds?(0 = fire-and-forget)
Notes:
mainis the canonical direct-chat key; global/unknown are hidden.messageLimit > 0fetches last N messages per session (tool messages filtered).sessions_sendwaits for final completion whentimeoutSeconds > 0.sessions_sendruns a reply‑back ping‑pong (replyREPLY_SKIPto stop; max turns viasession.agentToAgent.maxPingPongTurns, 0–5).- After the ping‑pong, the target agent runs an announce step; reply
ANNOUNCE_SKIPto suppress the announcement.
discord
Send Discord reactions, stickers, or polls.
Core actions:
react(channelId,messageId,emoji)reactions(channelId,messageId, optionallimit)sticker(to,stickerIds, optionalcontent)poll(to,question,answers, optionalallowMultiselect,durationHours,content)permissions(channelId)readMessages(channelId, optionallimit/before/after/around)sendMessage(to,content, optionalmediaUrl,replyTo)editMessage(channelId,messageId,content)deleteMessage(channelId,messageId)threadCreate(channelId,name, optionalmessageId,autoArchiveMinutes)threadList(guildId, optionalchannelId,includeArchived,before,limit)threadReply(channelId,content, optionalmediaUrl,replyTo)pinMessage/unpinMessage(channelId,messageId)listPins(channelId)searchMessages(guildId,content, optionalchannelId/channelIds,authorId/authorIds,limit)memberInfo(guildId,userId)roleInfo(guildId)emojiList(guildId)roleAdd/roleRemove(guildId,userId,roleId)channelInfo(channelId)channelList(guildId)voiceStatus(guildId,userId)eventList(guildId)eventCreate(guildId,name,startTime, optionalendTime,description,channelId,entityType,location)timeout(guildId,userId, optionaldurationMinutes,until,reason)kick(guildId,userId, optionalreason)ban(guildId,userId, optionalreason,deleteMessageDays)
Notes:
toacceptschannel:<id>oruser:<id>.- Polls require 2–10 answers and default to 24 hours.
reactionsreturns per-emoji user lists (limited to 100 per reaction).discord.actions.*gates Discord tool actions;roles+moderationdefault tofalse.searchMessagesfollows the Discord preview spec (limit max 25, channel/author filters accept arrays).- The tool is only exposed when the current surface is Discord.
Parameters (common)
Gateway-backed tools (canvas, nodes, cron):
gatewayUrl(defaultws://127.0.0.1:18789)gatewayToken(if auth enabled)timeoutMs
Browser tool:
controlUrl(defaults from config)
Recommended agent flows
Browser automation:
browser→status/startsnapshot(ai or aria)act(click/type/press)screenshotif you need visual confirmation
Canvas render:
canvas→presenta2ui_push(optional)snapshot
Node targeting:
nodes→statusdescribeon the chosen nodenotify/camera_snap/screen_record
Safety
- Avoid
system.run(not exposed as a tool). - Respect user consent for camera/screen capture.
- Use
status/describeto ensure permissions before invoking media commands.
How the model sees tools (pi-mono internals)
Tools are exposed to the model in two parallel channels:
- System prompt text: a human-readable list + guidelines.
- Provider tool schema: the actual function/tool declarations sent to the model API.
In pi-mono:
- System prompt builder:
packages/coding-agent/src/core/system-prompt.ts- Builds the
Available tools:list fromtoolDescriptions. - Appends skills and project context.
- Builds the
- Tool schemas passed to providers:
- OpenAI:
packages/ai/src/providers/openai-responses.ts(convertTools) - Anthropic:
packages/ai/src/providers/anthropic.ts(convertTools) - Gemini:
packages/ai/src/providers/google-shared.ts(convertTools)
- OpenAI:
- Tool execution loop:
- Agent loop:
packages/ai/src/agent/agent-loop.ts - Validates tool arguments and executes tools, then appends
toolResultmessages.
- Agent loop:
In Clawdbot:
- System prompt append:
src/agents/system-prompt.ts - Tool list injected via
createClawdbotCodingTools()insrc/agents/pi-tools.ts