Skip to main content
Glama

run_command

Destructive

Execute shell commands in the workspace and return exit code, stdout, and stderr so you can diagnose issues or automate tasks.

Instructions

Run a shell command and return exit code, stdout and stderr. Uses PowerShell on Windows and the default shell elsewhere. The working directory must be inside the workspace (default: the workspace root). The command itself is NOT confined: a shell can still reach any path the server's user can. Secret-named environment variables are removed and output is redacted.

Input Schema

NameRequiredDescriptionDefault
cwdNo
commandYes
timeoutNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.7/5.0
Behavior4/5

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

With annotations already declaring destructiveHint=true and openWorldHint=true, the description still adds genuinely non-obvious behavior: the shell is not sandboxed, secret-named environment variables are stripped, and output is redacted. The honest caveat that 'the command itself is NOT confined' is exactly the kind of context an agent cannot infer from 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?

Front-loaded with purpose and return values, then constraints ordered from most to least surprising. Every sentence carries information; only the line-wrapping artifacts make it read slightly longer than it is.

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?

An output schema exists, so return format needn't be spelled out, and the security/execution profile is well covered for a destructive, open-world tool. The gap is the unaddressed timeout parameter and no mention of output truncation or long-running command behavior.

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 0%, so the description must carry parameter meaning. It does explain cwd semantics (must be inside workspace, defaults to root) and the command itself, but the timeout parameter — null by default, no indication of units or default duration — is completely undocumented in both schema and description.

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?

The description opens with a specific verb and resource — 'Run a shell command and return exit code, stdout and stderr' — so the agent knows exactly what the tool produces. It implicitly positions itself as the generic execution escape hatch versus purpose-built siblings like run_tests, lint, and git_* commands, but never states that differentiation explicitly.

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

Usage Guidelines3/5

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

It gives concrete operating constraints: the working directory must be inside the workspace, defaults to the workspace root, and the shell is PowerShell on Windows, default elsewhere. However, there is no guidance on when to prefer run_command over the many dedicated siblings (run_tests, lint, grep, glob), which is the main selection decision an agent faces.

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