Skip to main content
Glama

cancel_task

Stops a task by marking it cancelled and asks the running worker to terminate its agent process tree; use when work should be abandoned, not resumed.

Instructions

Stop a task: mark it cancelled, and ask the running worker to terminate its agent process tree. This is not undone by resuming, so use it only when the user wants the work abandoned. Task history and reports are kept, and it is safe to call again. A task that already COMPLETED or was REJECTED cannot be stopped. To get a stuck execution moving instead, use recover_workers or resume_pending_dispatch.

Input Schema

NameRequiredDescriptionDefault
task_idYesTask id, as shown in get_task_status or list results.
project_idYesRegistered project id, as returned by list_projects.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.3
    • addedInput schema / properties / project_id / description
      Added value: +"Registered project id, as returned by list_projects."
    • addedInput schema / properties / task_id / description
      Added value: +"Task id, as shown in get_task_status or list results."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing irreversibility ('not undone by resuming'), data retention ('Task history and reports are kept'), and idempotency ('safe to call again'), plus the terminal-state precondition. The only mild tension is with destructiveHint=false, but the description resolves it by clarifying that no history or reports are destroyed, so this reads as a state change rather than data destruction.

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

Conciseness5/5

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

Four short sentences, front-loaded with the action and its effect, then the irreversibility warning, then retention/idempotency, then the precondition and alternatives. No filler and no restatement of the name or schema.

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?

An output schema exists, so return values need no explanation, and the annotations cover the safety profile. For a two-parameter mutation tool, everything an agent needs to decide and call correctly — preconditions, reversibility, idempotency, and alternatives — is present.

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% and both parameters (task_id, project_id) are documented in the schema with pointers to the tools that produce them. The description adds no further meaning about the parameters, so the baseline 3 applies.

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

Purpose5/5

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

States a specific verb and resource ('Stop a task') and then spells out the two concrete effects: marking the task cancelled and asking the running worker to terminate its agent process tree. That level of specificity distinguishes it cleanly from siblings like resume_pending_dispatch, recover_workers, and reevaluate_execution.

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

Usage Guidelines5/5

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

Gives an explicit when-to-use condition ('use it only when the user wants the work abandoned') and names two alternatives with the situation that selects them ('To get a stuck execution moving instead, use recover_workers or resume_pending_dispatch'). It also states a when-not condition: a task that already COMPLETED or was REJECTED cannot be stopped.

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