mqtt_publish
Publish messages to MQTT topics with configurable QoS and retention settings for IoT and messaging applications.
Instructions
Publishes a message to a specific MQTT topic.
Args:
topic: The MQTT topic to publish to.
message: The message payload to send.
qos: The Quality of Service level (0, 1, or 2). Defaults to 0.
retain: Whether the message should be retained by the broker. Defaults to False.
Returns:
A confirmation message string.
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>",
"message": "<message>"
},
"name": "mqtt_publish"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | ||
| message | Yes | ||
| qos | No | ||
| retain | No |