Capability System
What Is a Capability
A Capability is a C-layer callable tool registered in the claw_cap system. Each Capability has a unique string id, a JSON input schema, and an execute function. The LLM calls Capabilities directly through the tool-use interface; developers can also invoke them via:
AT command:
AT+CLAW=cap,<id>[,<json_args>]Lua script:
cap.call("id", json_string)using thecapLua moduleInternal code:
claw_cap_call()C API
Capability Groups and Gating
Capabilities are organized into groups (cap_groups). Most groups are always visible to the LLM. Some groups are gated — hidden by default and unlocked only after the corresponding Skill is activated. This forces the LLM to acquire the right context before calling hardware-specific or resource-intensive tools.
Group |
Gate Skill |
Capabilities in the Group |
|---|---|---|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
(always visible) |
|
|
|
|
|
|
|
Capability Quick Reference
File Management
Capability |
Description |
|---|---|
|
Read file contents from |
|
Write or append file contents |
|
Delete a file (stops running Lua jobs using that path first) |
|
List files and subdirectories at a path |
|
Move or rename a file |
|
Copy a file to a new path |
|
Get file metadata (size, type, modification time) |
Skill Management
Capability |
Description |
|---|---|
|
List all available Skills (built-in + user) |
|
Activate a Skill for the current session; injects its SKILL.md context and unlocks its cap_groups |
|
Save a new user Skill (SKILL.md + optional scripts/main.lua) |
|
Delete a user-created Skill directory |
|
Deactivate a Skill from the session activation list |
Lua Execution
Capability |
Description |
|---|---|
|
Execute a Lua script synchronously; returns the |
|
Start a Lua script as a background job; returns |
|
Get a background job’s status and incremental log output (since_seq) |
|
List all background Lua jobs with their status |
|
Cooperatively stop a running background job |
Scheduler
Capability |
Description |
|---|---|
|
Add or update a scheduled job (supports event_type, delay_sec, interval_sec, cron) |
|
List all scheduled jobs |
|
Remove a scheduled job by ID |
|
Enable a previously disabled job |
|
Disable a job without removing it |
Board Hardware (requires activating ``board_hardware_info`` first)
Capability |
Description |
|---|---|
|
List all devices wired on the board (sensors, displays, etc.) |
|
Get full details for a device: chip, interface pin assignments, driver params |
|
Check whether a peripheral type is available and which pins/instances are free |
|
Get the board authoring schema (chip definitions, constraints) |
|
Reload the board.json configuration from VFS |
System Information
Capability |
Description |
|---|---|
|
Get free heap and historical minimum |
|
List all FreeRTOS tasks with state, priority, and stack watermark |
|
Get chip model, firmware version, uptime |
|
Get Wi-Fi SSID, channel, RSSI, IP address |
|
Soft-reset the device after a short delay |
Time
Capability |
Description |
|---|---|
|
Get current wall-clock datetime (UTC+8) and Unix timestamp |
|
Trigger SNTP sync and write the result to the system clock and RTC |
Network
Capability |
Description |
|---|---|
|
Send HTTP/HTTPS request (GET/POST/PUT/PATCH/DELETE/HEAD); returns status code and body |
|
Start persistent UDP broadcast/listen peer-discovery; fires callbacks on peers found/lost |
|
Stop the peer-discovery background service |
|
One-shot peer discovery (blocks until found or timeout) |
Audio Streaming (requires activating ``camera_capture`` first)
Capability |
Description |
|---|---|
|
Start both RX (UDP→speaker) and TX (DMIC→UDP) streams in one call |
|
Start DMIC-to-UDP streaming (push-to-talk gated in C layer) |
|
Start UDP-to-speaker reception; call before TX |
|
Stop both TX and RX stream tasks |
|
Get TX/RX running state and UDP packet counters |
AT Command Interface
List all registered Capabilities:
AT+CLAW=cap
List all installed Skills (calls the skill_list Capability):
AT+CLAW=cap,skill_list
Call a Capability with JSON arguments:
AT+CLAW=cap,<capability_id>,<json_args>
Examples:
AT+CLAW=cap,get_info
AT+CLAW=cap,file_list,{"path":"vfs:/skills/"}
AT+CLAW=cap,lua_run,{"path":"vfs:/tmp/test.lua","args":{}}
AT+CLAW=cap,skill_activate,{"name":"board_hardware_info"}
To target a specific session (for per-session cap_groups visibility):
AT+CLAW=cap,<capability_id>,<json_args>,sid,<session_id>
Calling Capabilities from Lua Scripts
Use the cap Lua module inside Skill scripts. cap.call always returns two values:
local cap = require("cap")
local cjson = require("cjson")
-- Correct: capture both ok (boolean) and result_json (string)
local ok, result_json = cap.call("get_current_time", "{}")
if not ok then
return '{"error":' .. (result_json or '"cap call failed"') .. '}'
end
local t = cjson.decode(result_json)
-- t.timestamp, t.datetime, etc.
-- Incorrect: captures only ok (the boolean true/false), discards the JSON payload
-- local result = cap.call("get_current_time", "{}") -- never do this