cancel_task
Stop a running or pending task, terminate its agent and spawned processes, and cascade the stop to live descendant tasks.
Instructions
Stop a running task, terminating the agent and any processes it spawned, and cascade the same stop to any live descendants this bridge can find.
Args: task_id: Identifier of the task to stop.
A launch still waiting for resources is stopped before it starts: the request is recorded, its
owner honours it at the next poll, and pending descendants are asked to stop too
(cascade.pending_cancel_requested).
Already-finished tasks are returned unchanged. Work the agent had already written to disk is left in place. Tasks started by an earlier harflow_mcp server process can be stopped too, via their recorded process group.
The cascade reaches nested dispatches that task's own agent made through harflow_mcp —
spawned_by/root_task_id lineage, best-effort, not a sandboxed guarantee — and the response
carries the result as cascade: cancelled_descendants (ids now cancelled),
sigkill_survivors (ids that resisted even SIGKILL), owner_still_settling (ids belonging to
a still-alive bridge server that has not settled them yet), not_signalled (ids that
could not be signalled at all, with why), and not_recorded (ids that were signalled but
whose cancelled status could not be written, with why — their records are left untouched).
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": {
"task_id": "<task_id>"
},
"name": "cancel_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||