Skip to main content
Glama
aiterm-mcp
by kitepon

ensure_forward

Maintain a persistent reverse SSH forward to a remote host and return the remote port that reaches a local 127.0.0.1 service. Call again to renew its keep-alive before reuse.

Instructions

Keep a reverse SSH forward alive for as long as it is needed, and return the port P on that machine that reaches this computer's 127.0.0.1:D. A detached process holds it (it survives this process), re-establishes it when it drops, and keeps the same P while it can. Returns when the forward is ready (30 s, else SEAT_FORWARD_UNAVAILABLE). Call again before the next use: every call keeps it needed for 120 s more, and a session bound to the id keeps it needed. remote.ssh pins the host key file and one identity (paths only; the detached process restarts ssh by itself, so the agent socket must stay stable).

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>",
      "to": "<to>"
    },
    "name": "ensure_forward"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesOpaque id of this forward (A-Z a-z 0-9 . _ -, 1-64). The id of a registered terminal binding joins that binding's own forward.
toYesWhere the forward leads on this computer: 127.0.0.1 and the port D
remoteNoThe machine to forward on: {host, user, port?, ssh: {known_hosts_file, host_key_alias?, identity_agent | identity_file}}. Required for an id that is not a terminal binding; ignored for one
remote_portNoAsk for this port on that machine and never move to another (default: the machine's sshd picks one and it is kept)

Output Schema

NameRequiredDescriptionDefault
idYes
portYes
readyNo
schemaYes
ready_atYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.70.112

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: a detached process survives the caller, re-establishes dropped forwards, preserves P when possible, returns within 30 s or fails with SEAT_FORWARD_UNAVAILABLE, and explains the 120 s keep-alive TTL. It also flags the SSH constraints — pinned host key file and single identity, and the requirement that the agent socket stay stable because the detached process restarts ssh itself.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose and result, then layers the keep-alive contract and SSH constraints. It is dense — one long paragraph with several parenthetical asides — but each sentence carries operational information rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex tool with nested objects, an output schema, and no annotations, the description covers the timeout, failure token, persistence model, port stability, and SSH identity requirements. An agent has enough to invoke it correctly and know when to call again.

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; the description adds real meaning beyond it by tying the keep-alive TTL to repeated calls with the same id and by explaining that remote.ssh pins paths only while the socket must remain stable. That goes beyond what the schema documents about the ssh and remote_port fields.

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 — keep a reverse SSH forward alive — and immediately defines the observable result (the port P on the remote machine that reaches 127.0.0.1:D). The lifecycle wording ('call again before the next use') distinguishes it from a one-shot status or release operation without needing the sibling list.

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 a clear operating pattern: call it, then call again before each use because each call extends the 'needed' window by 120 s, and a bound session also keeps it needed. It does not explicitly name forward_status or release_forward as the alternatives for checking or tearing down, so guidance is strong but not complete.

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