Skip to main content
Glama

Run a shell command on a device

pi_command_run
Destructive

Run shell commands over SSH on a remote Raspberry Pi or device, returning stdout, stderr, and exit code for automation and troubleshooting.

Instructions

Execute a shell command on the remote device via SSH. Returns stdout, stderr, and exit_code.

Input Schema

NameRequiredDescriptionDefault
commandYesShell command line to execute.
device_idYesIP address, hostname, MAC address, or device identifier of the target Raspberry Pi / SSH device.
timeout_msNoExecution timeout in milliseconds (default 30000, max 300000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/5.0
Behavior3/5

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

The description adds the return shape (stdout, stderr, exit_code) which is genuine value since no output schema exists, and it names SSH as the transport. However, annotations already declare destructiveHint=true and readOnlyHint=false, and the description says nothing about the risk of arbitrary command execution, authentication requirements (note the pi_device_authenticate sibling), or how non-zero exit codes are surfaced.

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?

Two short sentences, front-loaded with the action and transport, with no wasted wording. The tradeoff is that the terseness leaves behavioral gaps, but the structure itself is clean.

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

Completeness2/5

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

For an arbitrary, destructive remote-execution tool with no output schema, the definition omits key context: authentication prerequisites, whether output is truncated or size-limited, and how failures are reported. The return-value sentence is the only substantive addition.

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%, with device_id, command, and timeout_ms all documented including default and max timeout, so the schema carries the parameter burden. The description adds no meaning beyond it, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Execute') and resource ('a shell command on the remote device via SSH'), which an agent can distinguish from the sibling file, reboot, and install tools. It stops short of naming an alternative, but the operation is distinct enough that no confusion arises.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

There is no guidance on when to use this tool rather than the dedicated siblings such as pi_file_write, pi_path_delete, or pi_device_reboot, and no exclusions or prerequisites. The agent must infer that this is a general-purpose escape hatch.

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