按业务协议发送 MQTT 消息
mqtt_sendPublish MQTT messages by specifying a business template and variables: the topic and payload are rendered automatically and the connection is opened if needed. Use it for routine sends after initial setup.
Instructions
核心发送工具:指定模板名与业务变量,自动渲染主题和消息体并发布。若连接尚未建立会自动连接。之后日常使用只需调用本工具。
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": {
"template": "<template>"
},
"name": "mqtt_send"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template | Yes | 业务协议模板名称 | |
| variables | No | 业务变量键值对 | |
| connection | No | 覆盖模板默认连接(临时切到其它 Broker) | |
| autoConnect | No | 连接未建立时是否自动连接,默认 true | |
| qosOverride | No | 覆盖 QoS | |
| topicOverride | No | 覆盖渲染后的主题 | |
| retainOverride | No | 覆盖 retain |