Skip to main content
Glama

Run a shell command on a device

pi_command_run
Destructive

Execute non-interactive shell commands on remote SSH devices as the signed-in user; returns stdout, stderr, and exit code for remote administration and diagnostics.

Instructions

Execute a non-interactive shell command on the remote device via SSH, as the signed-in user. Returns stdout, stderr, and exit_code. Use the file tools for files; a command that prompts fails or waits until timeout_ms.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "device_id": "<device_id>",
      "command": "<command>"
    },
    "name": "pi_command_run"
  }
}

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

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds context the agent cannot get from them: execution over SSH, running as the signed-in user, non-interactive execution model, and the return shape (stdout, stderr, exit_code). It does not discuss privilege level (e.g. whether sudo is available), output truncation, or reversibility of destructive commands, which leaves some behavioral gaps for a destructive remote-shell tool.

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 short sentences, front-loaded with the core action, then return values, then the exclusion and failure mode. No filler or repetition of the name/title.

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?

With no output schema, the description usefully supplies the return fields, and all parameters are covered by the schema. For a destructive remote-execution tool, remaining gaps are working directory, environment/privilege context, and output limits, which are desirable but not blocking for correct invocation.

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 coverage is 100%, so the schema already documents all three parameters and the baseline is 3. The description does add real semantics to timeout_ms by explaining that a prompting command waits until it expires, but it says nothing about how command is interpreted (shell, quoting, working directory, environment).

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 gives a specific verb and resource ('Execute a non-interactive shell command on the remote device') plus the transport (via SSH) and the execution identity (as the signed-in user). It also carves out a boundary against the file-oriented siblings ('Use the file tools for files'), so an agent can tell what this tool is and is not for without opening the 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?

It explicitly routes file operations to the file tools and warns that interactive/prompting commands will fail or hang until the timeout — a concrete when-not condition. It stops short of naming device-management siblings (reboot, install, info) as alternatives, so the exclusion is category-level rather than exhaustive.

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