Publish a message
publishSend a message to an MQTT topic to issue commands to real IoT devices, such as turning a kitchen light off via a topic and JSON payload.
Instructions
Publish a message to an MQTT topic, e.g. to send a command to a device (topic 'home/kitchen/light/set', payload '{"state":"off"}'). This can change real devices.
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>",
"payload": "<payload>"
},
"name": "publish"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qos | No | MQTT QoS level | |
| topic | Yes | Exact topic to publish to (no wildcards) | |
| retain | No | Ask the broker to retain the message for new subscribers | |
| payload | Yes | Message payload, usually JSON or plain text |