Skip to main content
Glama

ssh_exec

Run a shell command on a remote host over an existing SSH session and get its stdout, stderr, and exit code. Use absolute paths or chained commands for multi-step tasks, since each call starts a fresh shell.

Instructions

Run a shell command on the remote host over an existing session and return its stdout, stderr, and exit code. Output is truncated if very large. Not a persistent shell — each call is a fresh exec_command, so cd and env vars set in one call don't carry to the next (chain with && or use absolute paths / a wrapper script for multi-step sequences).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
timeoutNo
session_idYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.4/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 behavioral burden, and it does this well. It discloses return values, output truncation for large outputs, and the non-persistent shell behavior that significantly affects how an agent chains commands. These are exactly the behavioral traits an agent needs beyond the raw schema.

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?

The description is concise, front-loaded with the core action and return values, then follows with the most important caveats. Each sentence adds substantive value with no fluff or repetition of schema fields.

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 a tool with no annotations and no output schema, the description is quite complete: it covers what the command does, what it returns, truncation behavior, and statefulness. It could be slightly stronger by explicitly referencing the need to establish a session with ssh_connect and clarifying timeout units, but these are minor gaps.

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 description coverage is 0%, so the description must compensate. It does meaningfully explain session_id as an existing session and command as a shell command, and the non-persistence note adds important semantics for command construction. However, the timeout parameter is not explained in terms of units or behavior, and the description does not fully cover all parameter nuances.

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?

The description clearly states the action—running a shell command on a remote host over an existing session—and specifies the outputs: stdout, stderr, and exit code. This differentiates it well from siblings like ssh_read_file, ssh_write_file, and ssh_connect. The scope is precise and immediately actionable.

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?

The description gives useful usage context by warning that each call is a fresh exec_command and that cd/env changes do not persist, with a concrete recommendation to chain with && or use a wrapper script. It does not explicitly name alternatives or state when to prefer ssh_read_file or ssh_write_file, but the guidance is clear enough for typical invocation decisions.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CrimsonCosmos/ssh-bridge-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server