Skip to main content
Glama

cancel_task

DestructiveIdempotent

Cancels an async generation task by removing queued ComfyUI jobs; for running tasks it only stops tracking, so use interrupt to halt generation.

Instructions

Cancel an async generation task. For queued tasks, this cancels the ComfyUI job. For tasks that are already running, this only removes the task from tracking - use 'interrupt' to actually stop the running generation.

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
taskIdYesThe task ID to cancel

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and readOnlyHint=false, so the mutation profile is known. The description adds genuinely non-obvious context the annotations cannot convey: for running tasks it only removes tracking and does not stop the generation, which prevents a costly misunderstanding. It stops short of saying what happens to outputs or completed tasks.

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?

Two short sentences with zero filler; the core action comes first and the state-dependent caveat follows. The sibling redirect is folded into the same sentence rather than padded out.

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?

For a one-parameter mutation tool with full schema coverage, no output schema, and complete annotations, the description supplies the state-dependent behavior and the alternative tool — everything an agent needs to call it correctly rather than reach for 'interrupt'.

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% for the single taskId parameter, so the schema already carries the meaning. The description adds no format, source, or lookup guidance beyond what the schema states, which is the expected baseline when the schema does the work.

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 ('Cancel an async generation task') and immediately differentiates its effect by task state. It also names the sibling tool 'interrupt' and explains what that tool does instead, so an agent can distinguish the two without opening either schema.

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

Usage Guidelines4/5

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

Gives clear conditional guidance: use this for queued tasks, and use 'interrupt' when a generation is already running. It does not address the remaining state (e.g. already completed or failed tasks), so the routing picture is strong but not exhaustive.

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