Skip to main content
Glama

Run a remote command

ssh_exec
Destructive

Run non-interactive shell commands on configured remote hosts and return exit code, stdout, and stderr; use cwd or chain commands because each call starts a new shell.

Instructions

Runs a shell command on a host and returns its exit code, stdout and stderr. The command gets no stdin and no terminal, so it must be non-interactive. Each call starts a fresh shell: use cwd, or chain with &&, instead of relying on an earlier cd. Large output is truncated in the middle; narrow it with grep, head or tail.

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
cwdNoDirectory to run the command in
hostYesName of a configured host, as returned by ssh_list_hosts
commandYesShell command line to run
timeoutSecNoSeconds to wait before giving up
maxOutputBytesNoCap for stdout and for stderr, each

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0-dev.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations only flag openWorldHint and destructiveHint; the description goes well beyond them by disclosing that there is no stdin/terminal, that every call is a fresh shell, and that large output is truncated in the middle with a per-stream byte cap. It does not say what happens when timeoutSec expires or what error surface a failed connection produces, which are the remaining behavioral gaps.

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?

Four short sentences, each front-loaded with a distinct constraint: what it returns, how the command must be shaped, shell-state lifetime, and output volume limits. Nothing is repeated from the schema and every sentence carries an actionable rule.

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?

With no output schema, the description still documents the return shape (exit code, stdout, stderr) and the truncation behavior, and it covers the two non-obvious invocation constraints (non-interactive, stateless shell). For a 5-parameter tool with fully described parameters, nothing an agent needs to call it correctly is missing.

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 on top by explaining the operational intent of cwd (substitute for a prior cd) and by framing maxOutputBytes through the truncation-in-the-middle behavior. host and timeoutSec semantics are left entirely to the schema wording.

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?

Opens with a specific verb+resource pair: 'Runs a shell command on a host', and immediately names the return payload (exit code, stdout, stderr). This is clearly distinguishable from the file-oriented siblings (ssh_read_file, ssh_write_file, ssh_list_dir) 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 Guidelines4/5

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

Gives strong, actionable usage context: the command must be non-interactive because there is no stdin or terminal, and the agent should use cwd or chain with && rather than relying on a prior cd. It stops short of explicitly routing to a sibling (e.g. 'prefer ssh_read_file over cat'), so it lacks a true when-not/alternative statement.

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