Skip to main content
Glama

tuya_toggle_device

Toggle any Tuya or Smart Life device on or off using its device ID or name. Automatically switches the device to the opposite state.

Instructions

Toggle a Tuya device on/off by device_id or name (e.g. 'Living Room Light'). Turns it on if off, turns it off if on

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
device_idYes
switch_codeNoswitch_1

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It explains the toggle behavior, but it also claims the tool works 'by name' ('Living Room Light') while the input schema only has a device_id parameter, which is misleading. It also does not disclose how the toggle is performed (e.g., state read or raw command), potential failure modes, or permissions.

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 brief and front-loaded with the primary action. The two-sentence structure is efficient, but the unsupported 'or name' claim adds a bit of unnecessary and potentially confusing text, preventing a perfect score.

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

Completeness3/5

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

The tool is simple and an output schema exists, so return values do not need explanation. However, the description toggles the device but does not explain what switch_code does, how name-based lookup works, or how an unknown device state is handled. These gaps make the description only minimally adequate for reliable invocation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It adds some context for device_id by implying it may be a name, but this conflicts with the schema's field name. The switch_code parameter is not mentioned at all, leaving its purpose and usage undefined.

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 states the action (toggle) and the resource (Tuya device), and specifies the behavior: it turns the device on if off and off if on. This distinct behavior separates it from the sibling tools tuya_turn_on_device and tuya_turn_off_device.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: when you want the device state to flip. It does not explicitly mention alternatives or 'when-not to use', but the toggle semantics are self-evident, and no ambiguous conditions are raised.

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/juanmartinsantos/mcp-server-tuya'

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