cap_system — System info, time queries, and device restart
Source: cap_system.ccomponents/claw_capabilities/cap_system/src/cap_system.c · Header: cap_system.hcomponents/claw_capabilities/cap_system/include/cap_system.h
Positioning
Section titled “Positioning”cap_system provides a unified entry point for runtime status and current local time queries, plus a controlled restart operation. It is a system-level tool group directly callable by the LLM, suitable for device diagnostics, health checks, and remote recovery.
Tools exposed to LLM
Section titled “Tools exposed to LLM”| Tool ID | Function | Input Parameters |
|---|---|---|
get_system_info | Return system information; omit sections for the full summary | sections (optional array of chip / uptime / memory / cpu / wifi / ip) |
get_current_time | Return formatted current local time; sync with SNTP first when the system clock is invalid | (None) |
restart_device | Schedule a delayed device restart | delay_ms (optional, milliseconds) |
Response structure notes
Section titled “Response structure notes”- When
sectionsis omitted,get_system_infocombines multiple sub-objects:memory,cpu,wifi,ip, plus chip and uptime fields. - Use
sectionsto request only selected structures, for example{"sections":["memory","wifi"]}. - If FreeRTOS runtime stats are not enabled, the
cpusection returnssupported: falseplus an explanatory message. - When not connected, the
wifi/ipsections returnconnected: falsewith empty-value fields. get_current_timereturns local time inYYYY-MM-DD HH:MM:SS TZ (weekday)format; when the system time is earlier than 2024-01-01, it attempts SNTP sync first.
restart_device behavior
Section titled “restart_device behavior”delay_msis optional. If omitted or set to0, the default delay is used. Currently, the default is 500ms.- Restart is scheduled asynchronously: the tool returns success first, then a background task executes
esp_restart(). - On failure, it returns
ok: falsewith an error-code string.
Example:
Possible result: