Skip to main content
Glama

agent_ex_cancel

Cancel a running background agent task by ID, terminating its whole process group. Returns the current status unchanged if the task already finished.

Instructions

取消任务(状态感知、幂等):running 杀整个进程组;已终态则原样返回当前状态。 若返回带warning,说明进程树快照不可用(ps 被拒),组外逃逸的 agent 子进程可能残留。

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

Input Schema

NameRequiredDescriptionDefault
task_idYes任务 id

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does well: it discloses destructive scope (the entire process group, not just the task), idempotency, terminal-state behavior, and the meaning of a warning in the response. Gaps remain on permissions/authorization, on whether the call blocks until termination, and on irreversibility.

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 compact sentences, front-loaded with the core semantics and followed by the exception case (warning / escaped processes). Every clause carries operational meaning; nothing is padding.

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

Completeness4/5

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

For a one-parameter, no-output-schema, destructive terminal operation, the definition covers state handling, idempotency, and the failure caveat about orphaned child processes. Only secondary details such as auth requirements and whether it waits for the kill to complete are absent.

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?

There is only one parameter and schema description coverage is 100%, so the schema already fully documents task_id. The description adds no extra meaning about the id (format, where it comes from), leaving this at the baseline.

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 (cancel) plus resource (task_id) and immediately qualifies the scope: on a running task it kills the whole process group, on a terminal task it is a no-op returning current state. This is clearly distinguishable from the sibling status/restart/submit tools without opening any 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?

The 'state-aware, idempotent' framing effectively tells the caller no pre-check is required, since a call against a terminal task simply returns its state. It does not, however, explicitly contrast itself with agent_ex_restart or agent_ex_status, so the agent must infer which sibling to pick for a restart-style flow.

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