Skip to main content
Glama

agent_peer_task_cancel

Cancel an active delegated task running on a peer agent by signaling an irreversible halt; verify task status first to avoid aborting completed work.

Instructions

Signal cancellation for an active delegated task running on the peer agent. Irreversible state transition; halts remote execution if the task has not already completed. Call agent_peer_task_status first to verify the task is still running.

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_peer_task_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonNoHuman-readable explanation for why the task is being aborted
task_idYesThe unique task identifier of the active task to cancel

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • changedInput schema / properties / reason / description
      Previous value: -"Reason for cancellation"New value: +"Human-readable explanation for why the task is being aborted"
    • changedInput schema / properties / task_id / description
      Previous value: -"The unique task identifier to cancel"New value: +"The unique task identifier of the active task to cancel"
  2. First observedv0.1.0

TDQS

A4/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 behavioral burden and does real work: it declares the operation irreversible, explains the effect ('halts remote execution'), and notes the no-op case if the task already finished. It does not mention permissions, rate limits, or what response to expect, leaving those unaddressed.

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?

Three short sentences, front-loaded with the action, then the risk, then the precondition. Every sentence contributes and nothing is padded.

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 two-parameter mutation tool with no annotations and no output schema, the description covers purpose, irreversibility, effect, and the verification step. The remaining gap is return behavior — the agent is not told what a successful cancellation signal yields — but that is minor given the tool's simplicity.

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%, so both task_id and reason are already documented in the input schema. The description reinforces that task_id must reference an 'active' task but adds no format, syntax, or guidance on the optional reason beyond what is already there — baseline 3 applies.

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 and resource: 'Signal cancellation for an active delegated task running on the peer agent.' It is clearly distinct from agent_peer_task_complete because it targets in-flight work rather than finishing it, 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 Guidelines4/5

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

Gives a concrete precondition — 'Call agent_peer_task_status first to verify the task is still running' — which tells the agent when this tool is appropriate and how to qualify it. It stops short of stating when not to use it (e.g. versus agent_peer_task_complete) or what to do if the status check shows completion.

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