On this page
cancel_command
Cancels a command that has not been sent yet (waiting_approval or queued). If sending has already started, cancellation is not guaranteed and the current status is returned as is.
Arguments
From execute_device_action.
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: "cancel_command", arguments: { command_id: "cmd_3vX9" } });{
"command_id": "cmd_3vX9",
"status": "cancelled",
"reason_code": "user_cancelled",
"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": "show_result", "message": "Cancelled before it was sent." },
"next_poll_after_ms": null,
"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 |
|---|---|---|
| COMMAND_NOT_ACCESSIBLE | Unknown command or not yours | Check the command_id |
- COMMAND_NOT_ACCESSIBLE
- WhenUnknown command or not yours
- What to doCheck the
command_id