Skip to main content
Glama
ssh-sftp-mcp

ssh-sftp-mcp

by endjoker

Close an SSH connection

ssh_disconnect
DestructiveIdempotent

Close an SSH connection and its SFTP or exec channels to release resources and mark unfinished tasks as failed or unknown_after_disconnect.

Instructions

Closes the connection and its SFTP/exec channels and releases related task buffers. Idempotent: an already closed or unknown connection returns closed=false. Unfinished tasks on that connection end up as failed or unknown_after_disconnect.

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": {
      "connectionId": "<connectionId>"
    },
    "name": "ssh_disconnect"
  }
}

Input Schema

NameRequiredDescriptionDefault
connectionIdYes

Output Schema

NameRequiredDescriptionDefault
closedYes
connectionIdYes
affectedTasksYes
alreadyClosedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

The annotations already declare destructiveHint=true and idempotentHint=true, so their restatement adds little, but the description goes beyond them by naming exactly what is destroyed (channels, task buffers) and the resulting state of in-flight tasks ('failed or unknown_after_disconnect'). That is real operational context an agent needs before calling a destructive tool. It stops short of noting auth/permission requirements.

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?

Three short sentences, front-loaded with the action and its blast radius, then the idempotency edge case, then the side effect on tasks. No filler and nothing redundant.

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 destructive, single-parameter teardown tool with full annotation coverage and an output schema, this is close to sufficient: destruction scope, idempotency, and task fallout are all covered. The only missing piece is how to source the connectionId, which is the one thing that could cause a mis-call.

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?

A single parameter with 0% schema description coverage: the description never explains what a connectionId is or where to obtain one (e.g., from ssh_connect's response or ssh_connection_list). The tool is simple enough that this is a survivable gap, but the description does not compensate for the empty 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?

States a specific verb ('Closes') and resource ('the connection'), and enumerates the subordinate resources torn down (SFTP/exec channels, related task buffers). This cleanly separates it from ssh_connect and the ssh_exec/sftp_* tools without needing the schema.

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 rather than stated: the idempotency note tells an agent it need not check state first, and the task-impact note hints at cleanup ordering, but there is no explicit when-to-use vs. when-not guidance or reference to a sibling such as ssh_connection_list for finding a connectionId.

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