Subscribe Client To Topic
emqx_client_subscribeSubscribe a client to a topic on its behalf, without the client's awareness. The subscription is not recreated after a clean-session reconnect, so use cautiously.
Instructions
[DESTRUCTIVE] Add a subscription to a client on its behalf.
The device does not know this happened and will not re-create the subscription after a clean-session reconnect.
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": {
"clientid": "<clientid>",
"topic": "<topic>"
},
"name": "emqx_client_subscribe"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qos | No | MQTT QoS: 0, 1 or 2. | |
| topic | Yes | Topic filter to subscribe, e.g. 'sensors/+/temp'. | |
| clientid | Yes | Client id to act for. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||