Skip to main content
Glama

cancel_task

Terminate a running background task and its child process tree using its taskId to stop unwanted or stuck work.

Instructions

Cancel/terminate a running background task (and its child process tree) by taskId.

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

Input Schema

NameRequiredDescriptionDefault
taskIdYesTask ID returned by dispatch_* or run_shell(asyncMode=true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose an important non-obvious trait: the child process tree is also terminated. However, it does not say whether termination is graceful or forced, whether it blocks until the process exits, what happens if the task is already finished, or whether the call is idempotent — meaningful gaps for a destructive operation.

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?

One sentence, front-loaded with the action and ending with the parameter it needs. There is no redundant or filler wording.

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

Completeness3/5

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

For a single-parameter tool with a fully documented schema this is close to adequate, but it is a destructive operation with no annotations and no output schema, so the agent gets no signal about return value, failure modes, or reversibility of the cancellation.

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 the schema itself explains that taskId comes from dispatch_* or run_shell(asyncMode=true). The description only restates 'by taskId', adding no format, constraint, or error-condition detail beyond the schema.

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?

States a specific verb ('Cancel/terminate'), a specific resource ('running background task'), and a scope detail ('and its child process tree'). The action and its effect are unambiguous and distinguishable from read-oriented siblings like get_task_status or wait_task, though no sibling is named explicitly.

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 word 'running' implies this applies only to in-flight tasks, which is a mild usage constraint, but there is no explicit when-to-use, when-not-to-use, or pointer to alternatives (e.g., wait_task if you want to let it finish). Guidance is inferred rather than stated.

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