Skip to main content
Glama
Claude Code MCP

Claude Code MCP

by sarthchawla

claude_cancel

Cancel a running background job and its subprocess group to stop ongoing tasks and free associated resources.

Instructions

Cancel a running background job and its subprocess group.

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": {
      "job_id": "<job_id>"
    },
    "name": "claude_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
job_idYesBackground job ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.3/5.0
Behavior2/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 does add one valuable detail, that the whole subprocess group is terminated rather than a single process, but it says nothing about irreversibility, whether the job's partial output remains retrievable via claude_result, idempotency, or error behavior when the job is not running.

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?

A single sentence with the verb and blast radius front-loaded and no redundant wording. Nothing could be removed without losing 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?

There is no output schema and no annotations, so the description is the only source of behavioral information for a destructive operation. Mentioning subprocess-group termination is a good start, but for a cancel tool an agent still lacks guidance on post-cancellation state and result availability.

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 job_id parameter is documented there as 'Background job ID.' The description only implies that the ID must refer to a running job and adds no format, source, or lookup guidance, so 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 ('Cancel a running background job') plus the scope of effect ('its subprocess group'), which clearly distinguishes it from read-oriented siblings like claude_status and claude_result. It never names an alternative, so it sits at 4 rather than 5.

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

Usage Guidelines3/5

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

The qualifier 'running' implies the precondition that a job must currently be executing, which gives implied usage guidance. There is no explicit when-to-use statement, no mention of what to do instead if the job already finished, and no reference to claude_status for checking state before canceling.

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