On this page
execute_device_action
Runs one action on one device. Returns immediately with a command_id. A queued or provider_accepted status means the work has started, not that the device has changed. Call get_device first to read the action's input schema.
Arguments
From list_devices. Device IDs are opaque and never contain manufacturer identifiers.
An action the device supports, e.g. climate.set_temperature, outlet.power.set, door.lock. See the Actions catalog.
Validated against the action's JSON Schema before anything is sent. Defaults to {}.
Idempotency key. Resending the same key returns the same command. Reusing it with a different payload returns REQUEST_KEY_CONFLICT.
Returns: Command
waiting_approval queued dispatching provider_accepted verifying succeeded rejected failed cancelled expired outcome_unknown
level, required_level, provider_status, target_match, source, observed_at, deadline_at. See Verification.
What your agent should do next: poll_command_status, open_approval_url, show_result or show_unknown, plus a message safe to show the user.
Present when status is waiting_approval: approval_id, url and expires_at. Opening the URL does not approve.
Wait this long before calling get_command_status.
Why a command ended in rejected, failed, cancelled, expired or outcome_unknown. See Reason codes.
Only for commands that needed approval: console, mcp_url or mcp_form, with approval_channel_reason when in-chat approval was not possible.
Request
await client.callTool({
name: "execute_device_action",
arguments: {
device_id: "dev_8kq2",
action: "climate.set_temperature",
parameters: { temperature: 22, unit: "C" },
request_key: "precool-2026-10-18-1730"
}
});{
"command_id": "cmd_3vX9",
"status": "queued",
"reason_code": null,
"device_id": "dev_8kq2",
"action": "climate.set_temperature",
"parameters": { "temperature": 22, "unit": "C" },
"verification": {
"level": "none",
"required_level": "state_observed",
"provider_status": "unknown",
"target_match": "not_checked",
"source": null,
"observed_at": null,
"deadline_at": null
},
"approval": null,
"next_action": {
"type": "poll_command_status",
"message": "Queued. Check status shortly."
},
"next_poll_after_ms": 2000,
"expires_at": "2026-10-18T08:35:00Z"
}Errors
Errors before a command is created return isError: true with command_id: null. Problems after creation are a command status, not an error. Full list: Errors.
| Code | When | What to do |
|---|---|---|
| DEVICE_NOT_ACCESSIBLE | Unknown device, or not granted to this agent | Call list_devices; ask the user to grant access |
| PERMISSION_DENIED | Device is granted, this action is not | Ask the user to allow the action |
| ACTION_NOT_SUPPORTED | The device can't do this | Check get_device |
| POLICY_BLOCKED | Action halted by the operator, or the connection is disconnected | Tell the user; nothing to retry |
| INVALID_PARAMETERS | Fails the action's schema or range | Fix and resend with a new key |
| REQUEST_KEY_CONFLICT | Same key, different payload | Use a new request_key |
| QUOTA_EXCEEDED | All runs included in the current subscription period are used | Reads still work; see quotas |
| SUBSCRIPTION_REQUIRED | The owner's trial or subscription has ended | Tell the owner; cached state and history still work |
| DEVICE_INACTIVE | The owner hasn't activated this device | Ask the owner to activate it under My devices |
| CONSENT_REQUIRED | The owner hasn't agreed (or withdrew consent) to share device information with your service | Show the owner the consent_url; they decide in the console. No device data is returned until then |
- DEVICE_NOT_ACCESSIBLE
- WhenUnknown device, or not granted to this agent
- What to doCall
list_devices; ask the user to grant access
- PERMISSION_DENIED
- WhenDevice is granted, this action is not
- What to doAsk the user to allow the action
- ACTION_NOT_SUPPORTED
- WhenThe device can't do this
- What to doCheck
get_device
- POLICY_BLOCKED
- WhenAction halted by the operator, or the connection is disconnected
- What to doTell the user; nothing to retry
- INVALID_PARAMETERS
- WhenFails the action's schema or range
- What to doFix and resend with a new key
- REQUEST_KEY_CONFLICT
- WhenSame key, different payload
- What to doUse a new
request_key
- QUOTA_EXCEEDED
- WhenAll runs included in the current subscription period are used
- What to doReads still work; see quotas
- SUBSCRIPTION_REQUIRED
- WhenThe owner's trial or subscription has ended
- What to doTell the owner; cached state and history still work
- DEVICE_INACTIVE
- WhenThe owner hasn't activated this device
- What to doAsk the owner to activate it under My devices
- CONSENT_REQUIRED
- WhenThe owner hasn't agreed (or withdrew consent) to share device information with your service
- What to doShow the owner the
consent_url; they decide in the console. No device data is returned until then