Skip to main content
Glama

Cancel task

cancel_task
Destructive

Cancel an ad-hoc DevIntern task to withdraw a pending job or stop a running agent by task key, keeping its branch for later resume. Use when a queued or active task is no longer needed.

Instructions

Cancel an ad-hoc task. A pending task is withdrawn. A running task's agent is stopped by the worker (SIGTERM, then SIGKILL after a grace period) and its branch is kept, so it can be resumed later. Returns cancelling when the stop is still in progress. Same as devintern worker cancel.

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": {
      "taskKey": "<taskKey>"
    },
    "name": "cancel_task"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonNoWhy, recorded on the task
taskKeyYesAd-hoc task key (`local-…`), from get_queue

Output Schema

NameRequiredDescriptionDefault
messageNo
outcomeNo
taskKeyNo
errorCodeNoSet on failure: stable error code
nextStepsNoSet on failure: steps to run next (`command` runs on the worker host)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already flag destructiveHint=true and idempotentHint=false, yet the description adds real substance: a pending task is withdrawn, a running task's agent receives SIGTERM then SIGKILL after a grace period, and the branch is preserved for resumption. It also discloses the intermediate `cancelling` return state — behavior an agent cannot infer from the structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the action, then escalating detail on pending vs running outcomes in tight, waste-free sentences. The trailing CLI comparison is mildly redundant but still useful for agent-to-human mapping.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given an output schema exists, the description needn't enumerate return fields, and it still calls out the meaningful `cancelling` state. For a destructive single-target operation, the termination sequence, irreversibility of the stop, and resumability of the branch cover what an agent needs before invoking.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so both `taskKey` (with its `local-…` format and get_queue provenance) and `reason` (recorded on the task) are already documented. The description adds nothing about either parameter, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

"Cancel an ad-hoc task" gives a specific verb and a scoped resource (ad-hoc tasks, not runs), and the CLI equivalence ("devintern worker cancel") anchors it further. It does not explicitly name a contrasting sibling, so it stops just short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The pending-vs-running breakdown implies when cancelling is meaningful and what it costs, but there is no explicit when-to-use/when-not-to-use guidance or pointer to an alternative for cases this tool does not cover (e.g., runs vs ad-hoc tasks).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.