Skip to content

Capabilities overview

A capability is the uniform abstraction for anything callable in ESP-Claw. Each cap_* component registers one or more metadata-rich descriptors (claw_cap_descriptor_t) with claw_cap, and all execution funnels through the shared dispatcher.

Capabilities can play three roles:

RolekindMeaning
Callable toolCLAW_CAP_KIND_CALLABLEJSON in, text out; invokable from the LLM, Console, or automation
Event sourceCLAW_CAP_KIND_EVENT_SOURCELong-lived producer feeding claw_event_router
HybridCLAW_CAP_KIND_HYBRIDBoth callable and event emitting

Descriptors are grouped into capability groups (claw_cap_group_t)—the smallest unit for registration, start/stop, and LLM visibility toggles.

FamilyComponentsNotes
IM ingresscap_im_*Chat platforms as both event sources and send helpers
Filesystemcap_filesManaged FATFS CRUD + listing
Luacap_luaAuthor, sync/async run, and track Lua jobs
Skill admincap_skillRegister/unregister/activate/deactivate Skills (core as tools)
LLM inspectcap_llm_inspectNested multimodal calls over local images
Web searchcap_web_searchExternal search APIs
Timecap_timeDevice clock queries
System infocap_systemQuery system/memory/CPU/Wi-Fi/IP status and support operational actions like restart
Schedulercap_schedulerCron-like scheduling
Router admincap_router_mgrDynamic Event Router rule maintenance
MCPcap_mcp_*Model Context Protocol client/server
CLIcap_cliSurface caps through terminal helpers
Sessionscap_session_mgrSession state persistence

Every cap_* exposes cap_xxx_register_group() for the app to call during init:

// cap_files example
esp_err_t cap_files_register_group(void)
{
    if (claw_cap_group_exists(s_files_group.group_id)) {
        return ESP_OK;
    }
    return claw_cap_register_group(&s_files_group);
}

claw_cap_register_group enforces unique group ids, runs descriptor init hooks, then finishes registration. claw_cap_start_group later invokes start (e.g. launching the Telegram poll task).

Not every registered group is visible to the model. claw_cap_set_llm_visible_groups applies an allow-list controlling which tool schemas enter context:

// Typical boot policy: only baseline tools
static const char *VISIBLE_GROUPS[] = { "cap_files", "cap_skill", "cap_system" };
claw_cap_set_llm_visible_groups(VISIBLE_GROUPS, 3);

Other groups remain callable from the Console or automation; activating Skills expands the LLM-facing set.

Three primary entry points:

  1. LLM tool calls: claw_coreclaw_cap_call_from_core (session/channel aware)
  2. Console: cap call <name> <json> for direct execution
  3. Event Router rules: call_cap actions (see Dataflow and automation)

claw_cap_call_context_t.caller records whether the invoker was SYSTEM, AGENT, or CONSOLE.