Skip to main content
Glama

ssh_run

Destructive

Execute a command on an acquired Labgrid place via SSH and capture its output, errors, and exit status.

Instructions

Run command over SSH on an acquired place and return its result.

        Binds an ``SSHDriver`` (target.py, §11.13) and shells out via
        ``SSHDriver.run`` off the loop. Returns
        ``{"place", "stdout", "stderr", "exit_code"}`` -- labgrid returns
        stdout/stderr as line LISTS, joined here with ``"\n"``. The
        driver's own ``timeout=timeout_s`` is the sole enforcer of
        ``timeout_s``; the outer ``asyncio.wait_for`` only backstops a
        wedged thread with a small grace (``timeout_s + 5.0``) so it
        doesn't co-fire with the inner timeout. CAVEAT: a timeout does NOT
        kill the remote command -- ``subprocess`` does not reap on
        ``communicate(timeout=...)``, so the underlying ``ssh`` may linger
        until it finishes or the ControlMaster tears down. CAVEAT: labgrid
        whitespace-splits ``command`` (``cmd.split(" ")``) with no shell
        quoting, so multi-space or quoted arguments will split wrong.
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
placeYes
commandYes
timeout_sNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

The description goes far beyond the annotations, detailing timeout semantics (inner and outer enforcement), the lack of remote process termination on timeout, and labgrid's whitespace-splitting behavior. It also explains the return format (stdout/stderr as line lists joined with newlines). This provides deep behavioral transparency with no contradiction to annotations.

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?

The description is dense but every sentence is informative; caveats about timeouts and quoting are essential. The internal references (target.py, §11.13) add some noise, but the structure is logical and front-loaded with purpose.

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?

Despite the tool's complexity and the lack of an output schema, the description covers return values, timeout behavior, edge cases, and the execution mechanism. It is complete enough for an agent to use the tool correctly without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With schema coverage at 0%, the description compensates thoroughly: it explains 'command' and the whitespace-splitting caveat, details how 'timeout_s' is enforced (including the +5.0s grace period), and clarifies that 'place' must be an acquired place. This adds meaning far beyond the bare parameter names and types.

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 opens with 'Run command over SSH on an acquired place and return its result,' which clearly states the action, resource, and output. This distinguishes it from sibling tools like console_* (serial) and put_file/get_file (file transfer), giving it a specific identity.

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 clearly indicates the tool is for executing commands over SSH on an acquired place, providing strong contextual cues for when to use it. It does not explicitly name alternatives or exclusions, but the context is specific enough to guide selection among siblings.

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/onurcelep/labgrid-mcp'

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