Tools Overview
ESP-Claw comes with 40+ built-in tools that the AI agent can use to interact with hardware and software. Tools are called automatically based on the conversation context.
Hardware Tools
Section titled “Hardware Tools”| Tool | Description | GPIO Required |
|---|---|---|
gpio_read | Read digital pin state | Any GPIO |
gpio_write | Set digital pin high/low | Any GPIO |
pwm_set | Set PWM duty cycle | PWM-capable GPIO |
adc_read | Read analog voltage | ADC-capable GPIO |
dht_read | Read DHT22 temperature & humidity | Any digital GPIO |
servo_set | Set servo angle (0-180°) | PWM-capable GPIO |
neopixel | Control WS2812 LEDs | Any digital GPIO |
i2c_scan | Scan for I2C devices | SDA/SCL pins |
i2s_record | Record audio via I2S mic | I2S pins |
i2s_play | Play audio via I2S speaker | I2S pins |
ir_send | Send IR remote commands | IR LED GPIO |
Communication Tools
Section titled “Communication Tools”| Tool | Description | Requirements |
|---|---|---|
telegram_send | Send Telegram message | Bot token configured |
discord_send | Send Discord message | Bot token configured |
mqtt_publish | Publish MQTT message | Broker configured |
http_get | Make HTTP GET request | Wi-Fi connected |
http_post | Make HTTP POST request | Wi-Fi connected |
webhook | Trigger a webhook URL | Wi-Fi connected |
System Tools
Section titled “System Tools”| Tool | Description |
|---|---|
timer_set | Set a countdown timer |
cron_schedule | Schedule recurring tasks |
memory_save | Save to persistent memory |
memory_read | Read from persistent memory |
ota_check | Check for firmware updates |
deep_sleep | Enter low-power sleep mode |
system_info | Get device status (uptime, memory, etc.) |
wifi_scan | Scan nearby Wi-Fi networks |
Creating Custom Tools
Section titled “Creating Custom Tools”You can register your own tools using the C API:
esp_err_t my_tool_handler(const char *params, char *result, size_t len, void *user_data) { // Parse params JSON, do your thing, write result snprintf(result, len, "{\"status\": \"ok\", \"value\": 42}"); return ESP_OK;}
// Register during initclaw_tool_register("my_tool", "Description for the AI", my_tool_handler, NULL);See the API Reference for detailed documentation.