Skip to main content
Glama

Command on host

run
Destructive

Executes a command on a remote host and waits for the result. Handles timeouts, sudo passwords from ~/.ssh/.secret, and masks sensitive output.

Instructions

Run a command on a host and wait for the result.

On timeout the local ssh is killed (exit_code null, timed_out true) — use start for long-running commands. The sudo password is taken from ~/.ssh/.secret and masked in the output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory; defaults to home. `~` and `~/…` are expanded, everything else is taken literally.~
hostYesAlias from ~/.ssh/config.
sudoNoauto — decide from the command; true — prime the password unconditionally; false — don't prime it (needed where sudo is configured NOPASSWD).auto
stdinNoText for the command's stdin.
commandYesCommand for the host's shell.
timeoutNoSeconds; null — the default from settings. Above the server's cap — a call error.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
stderrYes
stdoutYes
durationYesduration, seconds
exit_codeYesreturn code; null — killed by timeout
sudo_usedYeswhether the sudo password was primed
timed_outYes
stderr_truncatedYes
stdout_truncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations flag this as destructive/open-world/non-idempotent, and the description adds genuinely non-obvious behavior beyond that: timeout kills the local ssh and yields exit_code null with timed_out true, and the sudo password is read from ~/.ssh/<host>.secret and masked in output. It does not discuss concurrency or interleaving of output, but the disclosure of failure semantics and secret handling is substantive.

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?

Front-loaded with the core action, then two tight clauses covering the timeout alternative and the sudo secret mechanism. No filler; the parenthetical details earn their place.

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?

An output schema covers return values, the annotations cover the risk profile, and all six parameters are fully described in the schema. The description supplies the timeout/secret behavior an agent needs to avoid misuse, so nothing material is missing.

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 100%, including defaults and enum behavior for 'sudo', so the schema does the heavy lifting. The description indirectly explains sudo handling (secret file) but adds no parameter-specific syntax or format detail beyond the schema, matching the baseline 3.

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 command on a host') plus the defining scope: it waits for the result. It explicitly contrasts itself with the sibling 'start' for long-running commands, so the agent can route correctly without opening either 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 a clear selection rule: use 'start' for long-running commands, since this tool's local ssh is killed on timeout. It does not state prerequisites such as whether the host must already be added or trusted, but the core when-to-use guidance is explicit.

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