Skip to main content
Glama

Shell cancel

shell_cancel
DestructiveIdempotent

Terminate a running shell command and its child processes when it hangs or its result is no longer needed, using the run ID and kill key from the original run.

Instructions

Kill a running command and its child processes. Needs run_id and kill_key from shell_run. Use when: a command hangs or its result is no longer needed. Avoid when: the run already finished (shell_status). Output: accepted, cleanup_complete.

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": {
      "run_id": "<run_id>",
      "kill_key": "<kill_key>"
    },
    "name": "shell_cancel"
  }
}

Input Schema

NameRequiredDescriptionDefault
run_idYesRun id from shell_run.
kill_keyYesKill key from shell_run; proves this caller started the run.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is covered; the description adds real context beyond that by disclosing the blast radius (child processes are killed too), the ownership proof requirement, and the output fields. It does not mention that repeat cancels are safe (idempotency semantics), which is the one behavioral detail left to the annotation.

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?

Four short, labelled lines — action, prerequisite, when, when-not, output — each carrying distinct information with no filler. Front-loaded with the imperative verb.

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 destructive tool with no output schema, the description covers action, prerequisites, routing, and a return hint ('accepted, cleanup_complete'). Only the meaning of a partial cleanup or a not-found run_id is left unstated, which is a minor gap rather than a blocking one.

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 schema already explains both run_id and kill_key, including that the kill key proves caller ownership. The description only restates that both come from shell_run, adding no format or edge-case detail beyond the structured fields, so the baseline 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 and resource — 'Kill a running command and its child processes' — and immediately scopes it beyond a single PID, which distinguishes it from shell_run and shell_status without opening either schema.

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?

Gives an explicit 'Use when' (a command hangs, or its result is no longer needed) and an explicit 'Avoid when' with the alternative named (the run already finished — use shell_status). This is exactly the routing information an agent needs.

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