Skip to main content
Glama

z2m_set_state

Send state commands to Zigbee devices or groups (e.g., turn ON/OFF, set brightness). Use 'get' mode to request a value without changing anything; confirm device action by reading state afterward.

Instructions

Send a state command to a device or group, e.g. {"state":"ON"} or {"brightness":128}. Physically changes what the device is doing, and is reversible by sending the opposite command. mode='get' instead requests a value without changing anything. The command is published without waiting for the device, so success here means the message was sent, not that the device acted — read z2m_get_device afterwards to confirm. Consult z2m_get_device exposes for valid properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoDefault 'set'.
deviceYesDevice or group friendly_name, or ieee_address.
payloadYesCommand payload, e.g. {"state": "ON"}.
Behavior5/5

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

Beyond annotations, the description discloses critical behaviors: the command is fire-and-forget (publication without waiting), success does not mean the device acted, and reversibility. It also clarifies that mode='get' does not change anything. This adds significant context absent from annotations.

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

Conciseness4/5

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

The description is a bit dense but every sentence adds relevant information. It is front-loaded with the primary action and contains no fluff, though it could potentially be tightened while retaining the essential caveats.

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

Completeness5/5

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

For a tool with no output schema, it effectively explains the outcome semantics (message sent vs device acted) and directs to z2m_get_device for confirmation. It covers all parameters and key behavioral nuances, making it sufficiently complete for an agent to use correctly.

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 baseline is 3. The description adds value by explaining the effect of mode='get' (no change) and providing additional payload examples, enriching the schema's basic descriptions.

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

Purpose5/5

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

The description clearly identifies the tool as sending a state command to a device or group, with concrete payload examples. It distinguishes from sibling read tools by noting mode='get' only requests a value, and from z2m_get_device which is for reading state.

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

Usage Guidelines5/5

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

It provides explicit guidance on when to use mode='get' vs 'set', and directs users to z2m_get_device to confirm device action and consult valid properties, naming the sibling tool as the alternative for reading.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alexpfau/zigbee2mqtt-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server