Skip to main content
Glama

run-command

Destructive

Executes a single-line shell command on a remote server via SSH, routing destructive or privileged actions through the profile's approval policy.

Instructions

Execute an arbitrary shell command on the remote server. May modify the system. Commands classified destructive or privileged go through the approval gate; approvalPolicy on the profile decides whether that is a prompt, an automatic allow, or a refusal. Single-line only: a command containing a line break is refused, so upload a multi-line script with sftp-upload and run it by path.

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": {
      "command": "<command>"
    },
    "name": "run-command"
  }
}

Input Schema

NameRequiredDescriptionDefault
ttyNoAllocate a pseudo-terminal
commandYesShell command to execute
profileNoProfile name
sessionNoRun in an existing interactive session (stateful)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.31.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv2.5.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations supply only destructiveHint=true; the description adds real behavioral context — arbitrary execution may modify the system, an approval gate can prompt, auto-allow, or refuse, and line breaks cause outright refusal. It does not cover timeout, output retrieval, or side effects on an existing session, which keeps it from a 5.

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 tight sentences: capability first, then safety/approval behavior, then the hard input constraint with the named workaround. Every sentence carries information an agent needs before invoking.

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?

For a four-parameter, high-risk execution tool with no output schema, the description covers the safety model and input constraints well, including where to look (profile) for approval policy. It leaves the agent without guidance on how execution output is surfaced, which is the remaining gap.

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 tty, command, profile, and session are already documented. The description adds a little meaning by tying 'profile' to an approvalPolicy setting, but says nothing about tty or stateful session behavior beyond what the schema states.

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 ('Execute an arbitrary shell command on the remote server') with the scope qualifier 'arbitrary' that separates it from the narrower read-command/destructive-command style siblings. An agent can immediately tell this is the general-purpose execution entry point.

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 two concrete routing rules: destructive/privileged commands are subject to an approval gate governed by approvalPolicy, and multi-line commands must go through sftp-upload and be run by path. It does not explicitly say when to prefer destructive-command or privileged-command over this tool, so one gap remains.

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