Skip to main content
Glama

pi_cancel

Cancel a queued, running, or async task by ID to stop work, free queue slots, and prevent further execution or acceptance steps.

Instructions

取消一个任务。 三种情况都支持,立即生效: · 排队中的 → 直接出队,不占用资源 · 正在跑的 → 立即中止,验收链不再继续 · 异步派发的 → 置取消标记 + 中止当前节点

【何时用】任务跑偏了(在乱改文件)、用户要求停止、或排队太久想腾出槽位。 【取消后】任务状态变 cancelled,可用 pi_result 查看最终状态。 【不要用】仅仅因为『等得有点久』就取消 —— 先 pi_status 看它是不是在正常干活。

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": "pi_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskIdYes要取消的任务 ID,从 pi_status 或派活返回值里拿。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses state-specific behavior (queued → dequeued, running → aborted so the acceptance chain stops, async → cancel flag + node abort), immediacy, and the resulting status being viewable via pi_result. It stops short of stating whether cancellation is reversible or what permissions are required, which keeps it from a 5.

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?

Front-loaded bolded purpose, then bullets for the three state cases, then bracketed sections for use / after-effect / do-not-use. Every line conveys distinct information and nothing is repeated.

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 no annotations and no output schema, the description covers triggers, per-state effects, the resulting status, and how to verify via pi_result. An agent has everything needed to decide and call correctly.

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 coverage is 100% and the single taskId parameter is already fully documented as coming from pi_status or dispatch returns. The description adds no format, ID-prefix, or validation detail beyond that, so the baseline of 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+resource (取消一个任务) up front and then enumerates the three task states it handles, so an agent knows exactly what this does. The sibling names pi_result and pi_status are woven in as follow-ups, distinguishing this from status/result reads.

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?

Has explicit 【何时用】 section naming three concrete triggers (task going off-track, user asks to stop, queue slot pressure) and an explicit 【不要用】 exclusion routing to pi_status when the wait is merely long. This is the when/when-not/alternative pattern at full strength.

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