Subscribe and collect messages
subscribeCollects messages from an MQTT topic filter for a few seconds and returns them, enabling live device traffic inspection and current sensor readings.
Instructions
Subscribe to an MQTT topic filter and collect incoming messages for a few seconds, then return them. Good for watching live device traffic, e.g. 'what is the living room sensor sending right now?'.
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": {
"filter": "<filter>"
},
"name": "subscribe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | Yes | MQTT topic filter, wildcards + and # allowed | |
| maxMessages | No | Stop early after this many messages | |
| durationSeconds | No | How long to listen, in seconds |