reachthingsDocs
EN
Dashboard
Action toolsexecute_device_action
On this page
TOOLscope: devices:control · destructiveHint

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

device_idstringrequired

From list_devices. Device IDs are opaque and never contain manufacturer identifiers.

actionstringrequired

An action the device supports, e.g. climate.set_temperature, outlet.power.set, door.lock. See the Actions catalog.

parametersobject

Validated against the action's JSON Schema before anything is sent. Defaults to {}.

request_keystring · 8–128required

Idempotency key. Resending the same key returns the same command. Reusing it with a different payload returns REQUEST_KEY_CONFLICT.

Returns: Command

statusenum

waiting_approval queued dispatching provider_accepted verifying succeeded rejected failed cancelled expired outcome_unknown

verificationobject

level, required_level, provider_status, target_match, source, observed_at, deadline_at. See Verification.

next_actionobject

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.

approvalobject | null

Present when status is waiting_approval: approval_id, url and expires_at. Opening the URL does not approve.

next_poll_after_msinteger | null

Wait this long before calling get_command_status.

reason_codeenum | null

Why a command ended in rejected, failed, cancelled, expired or outcome_unknown. See Reason codes.

approval_channelenum

Only for commands that needed approval: console, mcp_url or mcp_form, with approval_channel_reason when in-chat approval was not possible.

Request

REQUESTTypeScript ▾
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"
  }
});
RESPONSE · structuredContent
{
  "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.

CodeWhenWhat to do
DEVICE_NOT_ACCESSIBLEUnknown device, or not granted to this agentCall list_devices; ask the user to grant access
PERMISSION_DENIEDDevice is granted, this action is notAsk the user to allow the action
ACTION_NOT_SUPPORTEDThe device can't do thisCheck get_device
POLICY_BLOCKEDAction halted by the operator, or the connection is disconnectedTell the user; nothing to retry
INVALID_PARAMETERSFails the action's schema or rangeFix and resend with a new key
REQUEST_KEY_CONFLICTSame key, different payloadUse a new request_key
QUOTA_EXCEEDEDAll runs included in the current subscription period are usedReads still work; see quotas
SUBSCRIPTION_REQUIREDThe owner's trial or subscription has endedTell the owner; cached state and history still work
DEVICE_INACTIVEThe owner hasn't activated this deviceAsk the owner to activate it under My devices
CONSENT_REQUIREDThe owner hasn't agreed (or withdrew consent) to share device information with your serviceShow 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