Skip to main content
Glama

Yeelight IoT MCP Server

control_node

工具用途:节点控制

  • 家庭、区域、房间、设备组、设备都被视为"节点",其类型通过 nodeType 区分。

  • 节点控制请求中的 nodeId 是节点的唯一标识。用户通常提供的是节点名称,因此在调用控制接口前,必须先使用相应工具获取节点nodeId,nodeId可以是家庭ID,区域ID,房间ID,设备组ID,设备ID,确认后再执行控制操作。

  • 节点控制指令通过 command 区分不同的操作。

  • 控制指令中参数的 value 类型需与节点属性值的类型一致。

  • 在调用此接口之前,请先确认节点支持的属性及其对应的可操作类型。如果目标节点不支持该属性,则无法进行控制。

  • 控制指令中的propName(参数名称propName请勿传错)参数,必须填写节点属性列表中对应属性的 propId 字段值,如 p(开关)、c(颜色)、ct(色温)、l(亮度)、tp(窗帘开合度)等。应根据节点属性列表中支持的 propId 选择最合适的属性来进行控制操作。

控制节点说明

家庭、区域、房间、设备组、设备都被视为"节点",其类型通过 nodeType 区分。

例如:

  • "关闭所有灯"的请求,可视为关闭家庭下所有的灯,可以使用家庭节点类型来实现。

  • "打开客厅灯"的请求,可以使用房间节点类型来实现。

节点类型(nodeType)信息列表

节点类型(node)

节点编码(nodeType)

节点描述

说明

house

5

家庭

例如:"关闭所有灯"的请求,可视为关闭家庭下所有的灯,可以使用家庭节点类型来实现。先通过获取家庭信息工具获取到家庭ID,再使用家庭ID控制家庭下的所有灯。

area

3

区域

控制某个区域,可先通过获取区域的工具获取到区域ID,来控制区域。

room

1

房间

控制某个房间,可先通过获取区域的工具获取到房间ID,来控制房间。

group

4

设备组、灯组

控制某个设备组,可先通过获取区域的工具获取到设备组ID,来控制设备组。

device

2

设备

控制某个设备,可先通过获取区域的工具获取到设备ID,来控制设备。

控制属性说明

  • 可以通过其他工具获取到节点支持的属性定义列表,表示该节点所支持的属性。所控制节点的属性必须在该节点的属性定义列表中存在,否则会发生错误。

  • 调用该工具控制节点属性时,传入的属性值需符合属性定义中的类型、取值范围、枚举值等的要求。

  • 默认 dryRun=true,只返回执行计划,不调用真实控制接口。

  • 如需真实执行,必须显式传 dryRun=false 且 confirmSideEffect=true。

相关属性信息列表

下面是一些属性的定义,可能会与其他工具中返回的属性定义冗余,供参考。

属性编码(propId/propName)

属性描述(desc)

属性格式(format)

属性单位(unit)

属性值范围(valueRange)

属性值枚举(valueList)

属性支持的操作(operators)

属性说明

p

开关属性(仅用于标识灯和开关类设备的开关状态)

boolean

-

-

true:开, false:关

set

true:开, false:关

l

亮度

uint8

%

min:1;max:100;step:1;

-

set

例如:80表示亮度值为80%

c

颜色

uint32

RGB

min:0;max:16777215;step:1;

-

set

十进制整形的RGB颜色表示。例如16711680表示红色(十六进制表示为#FF0000), 255表示蓝色(十六进制表示为#0000FF)

ct

色温

uint8

K

min:2700;max:6500;step:1;

-

set

色温

tp

窗帘目标开合度

uint8

%

min:0;max:100;step:1;

-

set

窗帘目标开合度,用于控制窗帘开合度,0代表完全关闭,100代表完全打开。例如30表示窗帘开合度为30%

Input Schema

NameRequiredDescriptionDefault
controlRequestYes节点控制请求体,包含节点ID、节点类型、控制指令和 dryRun/confirmSideEffect 选项

Output Schema

NameRequiredDescriptionDefault
okYes是否允许或完成执行
codeYes结果编码
planYes执行计划
dryRunYes是否为 dryRun
messageYes结果说明
responseNo真实执行响应

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses that dryRun defaults to true (plan only), that real execution requires both dryRun=false and confirmSideEffect=true, and that control fails if the target node does not support the requested property. It omits permission/auth requirements and failure response behavior, so it falls short of a 5.

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

Conciseness3/5

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

It is front-loaded with a useful bullet list, but the node-type explanation is stated twice (the intro bullet and the full table repeat the '关闭所有灯' example), and the property table is explicitly flagged as possibly redundant with other tools. Content earns its place, but the repetition costs it a point.

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 multi-target control tool with nested command semantics, the description covers everything the agent needs: node acquisition flow, nodeType encoding, command types (set/toggle/adjust), property/value constraints, and the safety gating flags. An output schema exists, so return values need not be explained.

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 description coverage is 100%, so baseline is 3; the description adds real value on top by mapping propName to concrete propId values (p, c, ct, l, tp) and supplying a table of formats, units, value ranges and enumerations (e.g. c is RGB 0–16777215, l is 1–100%). This meaningfully supplements the terse schema for the most error-prone parameter.

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 opening section states a specific verb and resource ('节点控制' / node control) and immediately defines the resource scope: house/area/room/group/device are all 'nodes' distinguished by nodeType. It also names the sibling dependency (get_areas/get_rooms/get_devices etc. must be used first to obtain nodeId), so an agent can tell this apart from the retrieval tools without opening a schema.

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 gives explicit when-to-use routing: '关闭所有灯' maps to the house node type, '打开客厅灯' maps to the room node type, with a full nodeType table telling the agent which retrieval tool precedes each case. It also states the dryRun vs real-execution condition clearly, so there is no ambiguity about invocation mode.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.