读取收到的 MQTT 消息
mqtt_messagesRetrieve cached MQTT messages from active subscriptions, filtered by connection, topic pattern, or timestamp, and optionally clear the buffer after reading.
Instructions
读取订阅后缓存在内存中的消息。可按连接、主题过滤器、时间过滤;clear=true 表示读取后清空。
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "mqtt_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| clear | No | 读取后是否清空缓冲,默认 false | |
| limit | No | 最多返回条数,默认 50 | |
| since | No | 仅返回该 ISO 时间之后的消息 | |
| connection | No | 连接名称,留空读取所有连接 | |
| topicFilter | No | 主题过滤器,如 device/+/status |