Skip to main content
Glama

ssh_open

Open or reuse a persistent SSH session to a Linux device with selectable permission modes; subsequent command execution keeps the working directory and environment.

Instructions

打开(或复用)一台设备的持久 SSH 会话。模式:1=只读命令;2=只允许在 root 目录内修改;3=全部允许但 sudo 需要用户手动 unlock;4=完全权限(sudo 密码自动输入)。一次 open 之后用 ssh_exec 即可,cwd/env 会保持。

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": {
      "host": "<host>",
      "user": "<user>",
      "mode": "<mode>"
    },
    "name": "ssh_open"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYesIP 或主机名,例如 192.0.2.10
modeYes权限模式
portNoSSH 端口,默认 22
rootNo模式2 的工作目录,默认远端 HOME
userYesSSH 用户名
sessionNo会话名,默认由 host 生成
identityNoSSH 私钥路径(可选)
passwordNoSSH 密码(通常不用传,密码已保存在本地 vault)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior4/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 substantial work: it discloses session reuse semantics, the permission ladder from read-only to full sudo, that mode 3 requires a manual unlock, and that mode 4 auto-fills the sudo password. It omits session lifetime, timeout, and cleanup obligations, which matter for a persistent resource.

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?

Dense and front-loaded: the action and reuse behavior come first, then the mode ladder, then the follow-up tool and state persistence. The mode enumeration is long but every clause changes how the agent should call it, so there is little waste.

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 an 8-parameter, no-annotation, no-output-schema tool, the description covers the decisions that matter: which mode to pick, that the session is reused, and that state persists into ssh_exec. It does not cover failure modes or session teardown, which would complete the picture for a persistent connection.

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%, so the baseline is 3. The description does add real meaning beyond the schema by spelling out what each mode integer permits and tying mode 2 to a root working directory, which the schema only labels as '权限模式' and '模式2 的工作目录'.

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 — open or reuse a persistent SSH session on a device — and the parenthetical 'reuse' already distinguishes it from a fresh-connection tool. It also names ssh_exec as the follow-up tool, so an agent knows this is the setup step rather than the command runner.

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 usage pattern: open once, then issue commands via ssh_exec, with cwd/env preserved across calls. The four modes act as additional context for choosing how to open. It stops short of exclusions — nothing says when to prefer a one-shot path or when ssh_close is needed.

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