esp32_set_relay
Switch a specified ESP32 relay on or off by its 1-based index to control connected devices locally through the esp32-mcp server.
Instructions
Switch one relay on or off. Relay indexes are 1 based and are listed by esp32_health. The call is idempotent.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"relay": "<relay>",
"state": "<state>"
},
"name": "esp32_set_relay"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relay | Yes | 1 based relay index. | |
| state | Yes | Target state. |