Skip to content

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

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.

Tool IDFunctionInput Parameters
get_system_infoReturn system information; omit sections for the full summarysections (optional array of chip / uptime / memory / cpu / wifi / ip)
get_current_timeReturn formatted current local time; sync with SNTP first when the system clock is invalid(None)
restart_deviceSchedule a delayed device restartdelay_ms (optional, milliseconds)
  • When sections is omitted, get_system_info combines multiple sub-objects: memory, cpu, wifi, ip, plus chip and uptime fields.
  • Use sections to request only selected structures, for example {"sections":["memory","wifi"]}.
  • If FreeRTOS runtime stats are not enabled, the cpu section returns supported: false plus an explanatory message.
  • When not connected, the wifi / ip sections return connected: false with empty-value fields.
  • get_current_time returns local time in YYYY-MM-DD HH:MM:SS TZ (weekday) format; when the system time is earlier than 2024-01-01, it attempts SNTP sync first.
  • delay_ms is optional. If omitted or set to 0, 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: false with an error-code string.

Example:

{"delay_ms": 1500}

Possible result:

{"ok":true,"message":"device restart scheduled","delay_ms":1500}