Skip to main content
Glama
remote-ssh-mcp
by RuiFG

ssh_shell_exec

Destructive

Execute shell commands on a remote SSH host's working directory and return stdout, stderr, exit code, and outcome, with optional sudo and timeout controls.

Instructions

Execute a command in this host's working directory. Returns stdout, stderr, exitCode and outcome. Default timeout is 120 seconds; 0 disables it. sudo:true runs the entire command as root without an approval dialog; set sudo credentials with ssh_set_credentials when required. Never include passwords in command or stdin. Temporary cd does not change the stored directory. Never replay an unknown outcome automatically.

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": {
      "hostId": "<hostId>",
      "command": "<command>"
    },
    "name": "ssh_shell_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
sudoNo
stdinNo
hostIdYesRequired stable host ID returned by ssh_list_hosts. Names are not accepted.
commandYes
timeoutMsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructive/open-world/non-idempotent, and the description adds real value on top: the return fields (stdout, stderr, exitCode, outcome), the 120s default timeout with 0 disabling it, that sudo bypasses an approval dialog, and that a temporary cd does not persist. The warning against replaying unknown outcomes reinforces the non-idempotent hint with actionable advice.

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 core action comes first, then return fields, then timeout, sudo, and safety constraints. Every sentence carries information, though the trailing run of warnings reads as a flat list rather than a prioritized structure.

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 destructive, open-world mutation tool with no output schema, the description covers the essentials: what is returned, timeout behavior, privilege escalation path and its credential dependency, persistence of working directory, and the non-idempotency caveat. An agent has enough to call it correctly and safely.

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 only 20%, so the description must compensate, and it largely does: timeoutMs default and 0-disables semantics, sudo as full-root execution without approval, and stdin carrying a credential-safety warning. hostId is already documented in the schema; command is self-evident. The gap is that stdin's size/format and the interaction between sudo and credentials are only lightly touched.

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 ('Execute a command in this host's working directory') and scopes it to a host, which cleanly separates it from the file-oriented siblings such as ssh_read_file and ssh_write_file. An agent can identify the operation without opening 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete operational guidance: when sudo is appropriate, that credentials come from ssh_set_credentials, and that unknown outcomes must not be replayed automatically. It does not explicitly state when to prefer a sibling file tool over raw command execution, so routing guidance is implied rather than spelled out.

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