Skip to main content
Glama

close_session

Closes an open SSH session and tears down its shell connection; the session ID becomes invalid immediately, so open a new session to reconnect to the same host.

Instructions

Closes an open session: tears down its shell and SSH connection. The session id becomes invalid immediately; open a new session to reach the same host again.

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": {
      "sessionId": "<sessionId>"
    },
    "name": "close_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
sessionIdYesThe sessionId returned by open_session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description does real work by disclosing what gets destroyed (shell + SSH connection) and that the id is invalidated immediately — the key irreversible side effect. It does not cover authorization requirements, whether closing an already-closed session errors or is idempotent, or whether in-flight commands are killed.

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?

Two sentences, front-loaded with the action and its effect, followed by the operational consequence. No filler, and the most decision-relevant fact (id invalidated immediately) is in the leading position.

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 single-parameter teardown tool with no output schema, the essential information — what is destroyed and what the caller must do next — is present. Only edge-case behavior (error on already-closed session, effect on running commands, permissions) is left unstated.

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 sessionId parameter is documented in the schema as coming from open_session, so the schema carries the load. The description only adds that the value becomes unusable after the call, with no format or sourcing detail beyond the schema.

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?

Names a specific verb and resource ("Closes an open session") and immediately scopes it by what is torn down ("shell and SSH connection"), which cleanly separates it from open_session and from non-session tools like interrupt or cancel_runbook_run.

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 clear post-condition guidance: the id is invalid immediately and a new session is required to reach the same host, which implicitly routes the agent to open_session. It stops short of stating when not to call it (e.g., session already closed, or use interrupt for a running command instead of closing the session).

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