Skip to main content
Glama

cancel_task

Cancels a pending task by task ID before it starts; running or completed tasks cannot be canceled.

Instructions

取消尚处于 pending 状态的任务(已在运行或已结束的任务无法取消)。 Cancel a task that is still in 'pending' status.

Args: task_id: 要取消的任务 ID。

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

NameRequiredDescriptionDefault
task_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses the important precondition (pending-only) but says nothing about the effect of cancellation (deletion vs. status transition), idempotency, or what error surfaces when the task is not pending — significant gaps for a mutation tool with zero annotation coverage.

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?

Short and front-loaded, with the precondition stated before the Args block. The Chinese/English duplication is redundant for an agent but does not obscure meaning.

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 mutation tool with no output schema and no annotations, the definition covers the precondition but omits the outcome of a successful cancel and the failure mode. An agent knows when it may call this, but not what it gets back or how errors appear.

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

Parameters1/5

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

Schema description coverage is 0% and the only parameter guidance is '要取消的任务 ID', which merely restates the field name. Nothing is added about ID format, where the ID originates (presumably enqueue_task/list_tasks), or validation. With one undocumented parameter, the description does not compensate for the coverage gap.

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+resource ('cancel a task') plus a scope constraint ('still in pending status'), which lets an agent distinguish it from get_task_status or list_tasks. It stops short of naming any sibling explicitly, so differentiation comes from semantics rather than routing guidance.

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 an explicit exclusion: tasks already running or already finished cannot be cancelled. That is real when-to-use context. It does not point to an alternative when the precondition fails (e.g., which tool to use for a running task), so it falls just short of full guidance.

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

Deploy Server

Other Tools