mqtt_subscribe
Subscribe to MQTT topics to receive messages with configurable limits and timeout settings for monitoring IoT data streams.
Instructions
Subscribes to an MQTT topic and receives a specified number of messages or waits for a timeout.
Args:
topic: The MQTT topic to subscribe to (can include wildcards like + or #).
num_messages: The maximum number of messages to receive. Defaults to 1.
timeout: The maximum time (in seconds) to wait for messages. Defaults to 10.
Returns:
A list of dictionaries, where each dictionary represents a received message
with 'topic' and 'payload' keys.
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": {
"topic": "<topic>"
},
"name": "mqtt_subscribe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| num_messages | No | ||
| timeout | No |