订阅 MQTT 主题
mqtt_subscribeSubscribes to one or more MQTT topics, including + and # wildcards, and caches incoming messages in memory for later retrieval with mqtt_messages.
Instructions
订阅一个或多个主题(支持 + 和 # 通配符)。收到的消息会缓存在内存中,可用 mqtt_messages 读取。
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": {
"connection": "<connection>",
"topic": "<topic>"
},
"name": "mqtt_subscribe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qos | No | QoS,默认 0 | |
| topic | Yes | 主题或主题数组 | |
| connection | Yes | 连接名称 |