Skip to main content
Glama
slepp
by slepp

ssh_exec

Execute a single remote command via SSH and retrieve stdout, stderr, and exit code. Ideal for non-interactive tasks requiring remote directory or environment setup.

Instructions

Run a one-off remote SSH command and return stdout, stderr, and exit metadata. The command runs in a non-interactive context. Use 'cwd' and 'env' for remote directory and environment setup (requires a POSIX shell on the remote). For interactive or long-running commands, use ssh_ensure_session instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoRemote directory to cd into before running the command.
envNoRemote environment variables exported before the command runs.
ttyNoRequest a remote TTY (ssh -tt). Required for interactive commands (sudo with password prompt, etc.). Avoid for scripted commands: stdout and stderr are merged and ANSI escape codes will be present in output. Default: false.
portNo
shellNoRemote shell executable used to wrap the command when shell/cwd/env behavior is needed.
targetYesOpenSSH target such as host, alias, or user@host.
commandYesRemote command string to execute.
timeoutNoLocal timeout in seconds.
identity_fileNo
extra_ssh_argsNoAdditional ssh(1) flags passed verbatim, e.g. ["-J", "jumphost"]. Prefer the dedicated port, identity_file, and strict_host_key_checking parameters.
known_hosts_fileNo
strict_host_key_checkingNoBoolean or one of yes, no, ask, accept-new, off.
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses non-interactive behavior, the POSIX shell requirement, and that stdout/stderr/exit metadata are returned. However, it omits potential side effects of arbitrary command execution, authentication behaviors, and timeout handling.

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?

Three concise sentences: the first states the purpose and output, the second gives parameter guidance, and the third provides an alternative. Front-loaded and free of redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (12 parameters, no output schema), the description provides a good overview but does not fully specify return structure, timeout behavior, or edge cases. It explains enough to start using the tool, but the schema and sibling context are needed for complete understanding.

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?

The schema covers 75% of parameters with descriptions, so the baseline is 3. The description adds value by mentioning cwd and env, but does not compensate for the missing port, identity_file, and known_hosts_file descriptions. Those names are self-explanatory in an SSH context, so the marginal contribution is modest.

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 tool runs a one-off remote SSH command and returns stdout, stderr, and exit metadata. This specific verb and resource distinguish it from sibling session-management tools like ssh_ensure_session and ssh_start_session.

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 notes the non-interactive context and directs users to ssh_ensure_session for interactive or long-running commands. It also provides guidance on using cwd/env and the POSIX shell requirement, giving clear when-to-use and alternative instructions.

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

Install Server

Other Tools

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/slepp/ssh-mcp'

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