Cancel a task
cancelCancels one task of the owner's account: one of yours, or one another AI handed off (own: false in list_tasks), e.g. when the owner asks you to stop it. Idempotent. Later reports from the executor are rejected and the executor is told to stop. For a task of another AI the answer carries its state only (own: false); a reason is kept only for your own tasks. With only_if_waiting true it cancels only a task that has not started yet; use that before you do a queued task's work yourself. A task that already runs stays (cancelled false, started true): then do not do the work too.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "cancel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| number | No | Instead of task_id: the job's number as the owner says it ("stopp 714", "#714"); cancels every open task of that job. | |
| reason | No | ||
| task_id | No | ||
| reply_session | No | Only for a Claude Code web session or Claude project chat, and then on every call: your session id or claude.ai/code link (as reply_session in delegate). Only this chat's tasks then count as own; without it you also get other chats' tasks, questions and updates. | |
| only_if_waiting | No | Only while the task has not started: withdraw it because you do the work another way. A running task keeps running. |