Skip to main content
Glama

ssh_exec

Destructive

Run a single shell command on one of your servers and return its combined output and exit code. Runs keyless over Termalin's tunnel — no SSH key, and the server needs no open inbound port. Each call is a fresh shell (cd does not persist — chain with &&). On a Windows server the command is PowerShell (PowerShell 7 when installed, else Windows PowerShell 5.1); a program's stderr comes back as plain text and the exit code is the program's own. A call waits 60 seconds by default; pass 'timeout' (seconds, up to 300) for a bit longer, e.g. a sleep plus some work. Some chat apps stop waiting sooner than that, so for anything long (installs, builds, backups) use job_start and check on it with job_status.

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>",
      "command": "<command>"
    },
    "name": "ssh_exec"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostYesServer id from hosts_list
commandYesShell command to execute
timeoutNoMax seconds to wait for the command (default 60, at most 300). When it runs out, the answer says so; use job_start for long work.
usernameNoLogin user (defaults to the tunnel's user, else root)
timeoutSecondsNoSame as 'timeout' (older name).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / timeout
      Added value: +{
      +  "description": "Max seconds to wait for the command (default 60, at most 300). When it runs out, the answer says so; use job_start for long work.",
      +  "type": "number"
      +}
    • changedInput schema / properties / timeoutSeconds / description
      Previous value: -"Max seconds to wait (default 60). Calls longer than about 90 seconds are usually cut off by the network before they answer — run long jobs in the background instead."New value: +"Same as 'timeout' (older name)."
  2. Changed1 schema field changed
    • changedInput schema / properties / timeoutSeconds / description
      Previous value: -"Max seconds to wait (default 60, up to 300)"New value: +"Max seconds to wait (default 60). Calls longer than about 90 seconds are usually cut off by the network before they answer — run long jobs in the background instead."
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations declare destructive/openWorld/non-idempotent, and the description adds substantial context beyond them: keyless tunnel with no inbound port, a fresh shell per call (cd does not persist, chain with &&), PowerShell vs Windows PowerShell 5.1, stderr returned as plain text, and exit code provenance. It stops short of saying what permissions the tunnel user needs or what happens on timeout beyond 'the answer says so' (the timeout enforcement behavior is somewhat glossed).

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?

Purpose and scope are front-loaded in the first sentence, and each following sentence carries distinct operational information. Mild redundancy: the 60s/300s timeout behavior is restated from the schema's own parameter descriptions, and 'a bit longer' is vague for a hard cap.

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 5-parameter execution tool with no output schema, everything an agent needs is present: where host ids come from (hosts_list), shell persistence rules, OS-dependent interpreter choice, exit-code semantics, timeout ceiling, and the escalation path for long jobs.

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 baseline is 3, but the description adds real meaning: it explains why 'timeout' exists (long sleeps plus work) and ties 'command' semantics to shell persistence via &&. The 'username' fallback and the legacy 'timeoutSeconds' alias are left entirely to the schema, so not a 5.

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 ('run a single shell command on one of your servers') plus what comes back ('combined output and exit code'), which immediately distinguishes it from ssh_exec_many and from job_start. An agent can tell it apart from siblings without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicitly routes long-running work (installs, builds, backups) to job_start with job_status for polling, and explains why (chat apps stop waiting before the 300s cap). The condition that selects the alternative is stated concretely rather than left to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.