Skip to main content
Glama

ssh_tunnel

Start a persistent local port-forward over SSH to map a local port to a remote service; it stays open until stopped and returns the tunnel ID and local URL.

Instructions

Start a persistent local port-forward through the pooled SSH connection for host, e.g. forward local port 8080 to snow:80. The tunnel stays open until ssh_tunnel_stop is called. Returns the tunnel id and the local URL to use.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesSSH config alias to tunnel through
localHostNoLocal bind address127.0.0.1
localPortYesLocal port to listen on (0 = random)
remoteHostNoDestination host from the SSH server's perspective127.0.0.1
remotePortYesDestination port

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It does disclose the key trait of persistence and what the call returns (tunnel id + local URL), but says nothing about prerequisites (existing pooled connection/host alias), auth, port-collision failures, or resource cleanup on error.

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, zero filler, with the lifetime constraint and return value front-loaded. Every sentence earns its place.

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?

There is no output schema, so the description usefully explains the return (tunnel id, local URL) alongside lifetime semantics. Only gap is failure/error behavior, which leaves it slightly short of fully self-contained for a stateful networking tool.

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?

Schema coverage is 100%, so the baseline is 3, but the worked example ('forward local port 8080 to snow:80') adds real meaning by showing how host, localPort, and remotePort combine, which is more than the schema's per-field text conveys.

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?

Specific verb+resource: 'Start a persistent local port-forward through the pooled SSH connection for `host`', with a concrete example (local 8080 -> snow:80). An agent can distinguish it from siblings ssh_tunnels (listing) and ssh_tunnel_stop (teardown) directly from the description.

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?

Clearly states the lifecycle condition ('stays open until ssh_tunnel_stop is called'), which routes the agent to the teardown sibling. It does not explicitly say when to prefer this over a one-off ssh_exec or when not to open a tunnel, so the guidance is clear but not exhaustive.

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