Skip to main content
Glama

Shell cancel session

shell_cancel_session
DestructiveIdempotent

Terminate all shell runs started in a session to clear a stuck workspace. Use when tearing down a session with several running commands, not for stopping a single run.

Instructions

Kill every shell run started in this session. Use when: you tear down a stuck session with several running commands. Avoid when: only one run must stop (shell_cancel). Output: cancelled_run_ids[], count.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "shell_cancel_session"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.0.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the blast radius and safety profile are covered in structured data. The description adds the crucial scope detail that ALL runs in the session are terminated, not just one. It does not say what happens to runs in other sessions or whether partial failures are reported, which keeps it short of 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?

Four short labeled lines, front-loaded with the action, then the routing rules, then the return shape. Every clause carries distinct information and there is no filler.

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?

With no input parameters and no output schema, the description supplies exactly the missing pieces: the scope of the kill, the alternative for narrower cancellation, and the return fields (cancelled_run_ids[], count). Nothing an agent needs to invoke this correctly is absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so the baseline is 4: there is nothing for the description to clarify about inputs and no risk of ambiguity. The description correctly implies the session is the implicit scope rather than a passed parameter.

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?

"Kill every shell run started in this session" gives a specific verb (kill) and a precisely scoped resource (all runs in the current session). The word "every" and the session scope immediately distinguish it from the single-run sibling shell_cancel without needing to open 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?

Explicit "Use when" (tearing down a stuck session with several running commands) and "Avoid when" (only one run must stop, pointing to shell_cancel). This is a complete routing rule with the alternative named and the selecting condition stated.

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