mqtt_publish_sync
Publishes an MQTT message synchronously and waits for a reply, enabling request-response interactions between IoT devices.
Instructions
同步發布 MQTT 訊息並等待回應
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": {
"deviceId": "<deviceId>",
"topic": "<topic>",
"payload": "<payload>"
},
"name": "mqtt_publish_sync"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qos | No | QoS 等級 (預設: 0) | |
| topic | Yes | 目標裝置ID.動作,如 "targetDevice.action" | |
| payload | Yes | 訊息內容 | |
| timeout | No | 逾時時間 (毫秒,預設: 5000) | |
| deviceId | Yes | 發送方裝置 ID |