zclaw docs

chapter 2

Tool Surface

Tools are the execution boundary: model chooses calls, firmware enforces schema and executes side effects.

Built-In Tools

GroupToolsUse
GPIOgpio_write, gpio_read, delay, i2c_scanPins, timings, sensor bus checks.
Memorymemory_set, memory_get, memory_list, memory_deletePersistent user state (u_* keys).
Schedulescron_set, cron_list, cron_deletePeriodic, daily, and one-shot jobs.
Clockget_time, set_timezone, get_timezoneTimezone-aware schedule behavior.
Systemget_version, get_healthFirmware + runtime diagnostics.
User toolscreate_tool, list_user_tools, delete_user_toolNatural-language macro layer.

Schedule Grammar

cron_set accepts three schedule types:

TypeRequired InputsBehavior
periodicinterval_minutes, actionRepeats every N minutes.
dailyhour, minute, actionRuns at local device time daily.
oncedelay_minutes, actionRuns once after N minutes, then auto-removes itself.
{"type":"once","delay_minutes":20,"action":"check garage sensor"}

Scheduler resolution is minute-based. A one-shot fires on the next due cron scan.

User Tool Model

User-defined tools do not compile code. They store short action text that the model later translates into built-in tool calls.

You: Create tool "water_plants" to turn GPIO 5 on for 30 seconds then off
Agent internals:
1) create_tool(name="water_plants", action="Turn GPIO 5 on, wait 30 seconds, turn off")
2) Later invocation returns action text
3) Model executes via gpio_write + delay + gpio_write

Operational Boundaries

  • GPIO is constrained by configured safety policy.
  • Memory keys for user values must use u_ prefix.
  • Schedule action payload is bounded by CRON_MAX_ACTION_LEN.