Skip to content

cap_system — System info and device restart

Source: cap_system.c · Header: cap_system.h

cap_system provides a unified entry point for runtime status queries and 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 a system summary (chip, memory, CPU, Wi-Fi, IP, uptime)(None)
get_memory_infoReturn memory details (internal memory, heap, PSRAM)(None)
get_cpu_usageReturn CPU usage and runtime stats(None)
get_wifi_infoReturn current Wi-Fi status (SSID, RSSI, channel, etc.)(None)
get_ip_addressReturn current station IP / netmask / gateway(None)
restart_deviceSchedule a delayed device restartdelay_ms (optional, milliseconds)
  • get_system_info combines multiple sub-objects: memory, cpu, wifi, ip.
  • If FreeRTOS runtime stats are not enabled, get_cpu_usage returns supported: false plus an explanatory message.
  • When not connected, get_wifi_info / get_ip_address return connected: false with empty-value fields.
  • 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}