publish
Control IoT devices by delivering MQTT messages to their subscribed topics. Discover the correct topic via the discovery tool, then send a command payload to the device.
Instructions
Publish a message to a device using MQTT topic and payload. When asked to control a device, you should use this tool with the topic argument discovered from the "discover" tool. For example, a device might describe itself subscribing to a topic livingroom/456/command, then this is the topic to be used to control the device.
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 | ||
| topic | Yes | ||
| retain | No | ||
| payload | Yes |