Skip to main content
Glama
SSH MCP Server

SSH MCP Server

by icdmkg2

ssh_close_tunnel

Terminate an active SSH tunnel by its tunnel ID to stop port forwarding and release resources. Use the ID returned by local or remote forwarding to close that tunnel.

Instructions

Close an active SSH tunnel by its tunnel ID.

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": {
      "tunnelId": "<tunnelId>"
    },
    "name": "ssh_close_tunnel"
  }
}

Input Schema

NameRequiredDescriptionDefault
tunnelIdYesTunnel ID returned by ssh_forward_local or ssh_forward_remote

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the whole burden. The word 'Close' and the qualifier 'active' do convey that this terminates a live tunnel, which is useful, but it says nothing about what happens to in-flight forwarded traffic, whether the operation is idempotent, or what errors an invalid/already-closed ID produces.

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?

A single well-formed sentence with no filler; the action and the identifying input are front-loaded and nothing is wasted.

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, no-output-schema teardown tool the description is essentially sufficient, and the schema fully documents the ID. Minor gaps remain around side effects and failure modes, but nothing an agent needs to select or invoke the tool is missing.

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 100% and there is only one parameter, whose description already states it is the tunnel ID returned by ssh_forward_local or ssh_forward_remote. The description's 'by its tunnel ID' merely restates the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb and resource ('Close an active SSH tunnel') plus the keying mechanism ('by its tunnel ID'), which separates it from ssh_disconnect (connections) and ssh_forward_local/ssh_forward_remote (creation). It stops short of explicitly contrasting itself with a sibling, so 4 rather than 5.

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 only implied: 'active' signals it applies to tunnels that currently exist, and the schema hints the ID comes from ssh_forward_local or ssh_forward_remote. There is no explicit statement of when-not to use it, nor a pointer to ssh_list_tunnels for discovering IDs, and no mention of error behavior for an already-closed tunnel.

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