Skip to main content
Glama

run_command

Destructive

Execute ad-hoc shell commands inside a repository root; read-only operations run by default, while file-modifying commands require explicit write authorization.

Instructions

Run an ad-hoc shell command in a repository. Prefer run_task for known tasks or git_log/git_diff/read_file for read-only operations.

When no NPU is reachable, build/test commands (cmake, make, ninja, pip install, pytest, …) are refused — those must run inside the sim Docker images, never on the local repo. Read-only commands are unaffected.

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

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name from list_repositories(). The command runs with cwd set to that repo's root.
commandYesShell command to execute via bash. Destructive patterns (git reset --hard, rm -rf /) are blocked.
allow_writesNoExplicitly authorize commands that can modify files, build outputs, containers, or remote state. Keep False for read-only inspection.
timeout_secondsNoExecution timeout in seconds (1–7200)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.0
    • addedInput schema / properties / allow_writes
      Added value: +{
      +  "default": false,
      +  "description": "Explicitly authorize commands that can modify files, build outputs, containers, or remote state. Keep False for read-only inspection.",
      +  "title": "Allow Writes",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and non-idempotency, so the safety profile is covered. The description adds real context beyond that: environment-dependent refusal of build/test commands (cmake, make, ninja, pip install, pytest) when no NPU is reachable and the requirement to use sim Docker images, plus the fact that read-only commands are unaffected. It stops short of explaining the allow_writes gate or what a refused command returns.

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-loads the core action and the alternative routing in the first sentence, then the environment constraint. Two short paragraphs with no filler, though the hard line breaks split phrases awkwardly and the NPU clause could be presented as a single scannable condition.

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 annotations, a full schema and an output schema available, the description only needs to cover routing and unusual behavior — both are covered. The remaining omission is how allow_writes interacts with the commands the tool runs, which matters for a destructive-capable tool but is largely captured by the schema field text.

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%, so repo, command, allow_writes and timeout_seconds are already documented at the field level. The description adds no parameter guidance of its own — it never mentions allow_writes authorization or timeouts — so it neither compensates nor detracts; baseline 3 applies.

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 ('Run an ad-hoc shell command in a repository') and distinguishes itself from named siblings (run_task for known tasks, git_log/git_diff/read_file for read-only ops). An agent can identify exactly what this tool does and when it is the wrong choice.

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

Usage Guidelines5/5

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

Explicitly names three categories of alternatives and the conditions that select them: known tasks go to run_task, read-only inspection to git_log/git_diff/read_file. It also states the exclusion condition for build/test commands when no NPU is reachable, which is a real when-not rule rather than implied usage.

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