Skip to main content
Glama

shell_close

Close an open shell session by its ID to free the channel; returns SESSION_GONE if the ID is unknown or already closed.

Instructions

Close an open shell session by id and free its channel; returns SESSION_GONE when the id is unknown or already closed.

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": {
      "id": "<id>"
    },
    "name": "shell_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/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 it does disclose a real behavioral trait: the SESSION_GONE outcome for unknown or already-closed ids, implying idempotent-ish semantics. It omits other mutation-relevant behavior an agent needs — whether in-flight commands or child processes are terminated, permission requirements, and whether any payload is returned on success.

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?

One sentence, zero filler, with the action front-loaded and the error contract appended where it is most useful.

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 teardown tool with no output schema, the definition covers the action, the target, the side effect, and the failure signal. The remaining gap is only what happens to work still running in the session at close time.

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 description coverage is 0%, so the description must compensate; "by id" combined with "SESSION_GONE when the id is unknown" establishes that the single parameter is a session identifier and what an invalid value produces. It does not say how the id is obtained (e.g., from shell_open or shell_list) or its expected format, so the compensation is partial.

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 ("Close an open shell session by id") plus its effect ("free its channel"), which is enough for an agent to separate it from shell_open, shell_run, and shell_list without inspecting those schemas.

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?

Usage is implied by "open shell session" and "already closed" — the agent can infer this is for tearing down sessions it previously opened. There is no explicit when-to-use/when-not guidance or reference to a sibling for discovering session ids, leaving the routing to inference.

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