Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relayYes1 based relay index.
stateYesTarget state.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does disclose one genuinely important trait: the call is idempotent. It still does not say whether state persists after power loss, what happens on an out-of-range or unavailable relay, or whether any state is returned, which are material gaps for a hardware mutation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, front-loaded with the action, followed by index discovery and the idempotency note. There is no filler and every sentence carries information an agent needs.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter mutation with no annotations and no output schema, the description covers purpose, valid index sourcing, and idempotency, which is close to sufficient. What remains thin is failure behavior and return semantics, though with a fully documented schema the gap is modest.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, and the description adds real value on top by explaining that relay indexes are 1-based and can be enumerated via esp32_health. It does not mention the upper bound of 8 or restate the on/off values in any additional way, so it stops short of full marks.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource pair ("Switch one relay on or off") with clear single-unit scope, so an agent knows exactly what the tool does. It does not explicitly distinguish itself from the sibling esp32_gpio_write, which an agent could plausibly confuse with relay switching, so it falls short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description points to esp32_health as the way to discover valid relay indexes, which is useful routing guidance for setup. However, it never says when to prefer this over esp32_gpio_write or esp32_gpio_read, nor any precondition such as device being online, so usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.