Skip to main content
Glama

exec_command

Destructive

Runs allowlisted binaries such as pytest, ruff, git, or ls with static arguments, no shell expansion, a scrubbed environment, and a process-group timeout to safely execute workspace commands.

Instructions

Execute an allowlisted binary (e.g. pytest, ruff, mypy, git, ls) with shell=False, argument safety guards, scrubbed environment, and process-group timeout SIGKILL.

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": {
      "binary": "<binary>"
    },
    "name": "exec_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoRelative working directory inside the workspace root..
argsNoStatic argument list passed directly to the binary without shell expansion.
binaryYesAllowlisted binary name (e.g. 'pytest', 'ruff', 'git', 'ls') executed with shell=False.
timeout_secondsNoOptional execution timeout in seconds (clamped by policy max_timeout_seconds).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/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, and the description adds genuinely new behavioral detail: no shell expansion, argument safety guards, a scrubbed environment, and process-group timeout enforced with SIGKILL. The main omission is what happens on a non-allowlisted binary (rejection vs. error) and how output is returned.

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?

A single front-loaded sentence that packs the operation, its constraints, and its failure mode without any filler or repetition.

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

Completeness3/5

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

There is no output schema, and the description says nothing about return values (stdout/stderr, exit codes, truncation) or allowlist-rejection behavior, which matters for a process-execution tool. The safety profile is well covered between annotations and description, but the caller is left guessing about results.

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 every parameter is already documented, including the timeout clamp against policy max_timeout_seconds. The description reinforces 'shell=False' and static argument passing but adds no new semantics for cwd, args, or timeout beyond what the schema states.

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 names a specific verb and resource ('Execute an allowlisted binary') and grounds it with concrete examples (pytest, ruff, git, ls), so the agent knows this is a constrained command runner rather than a general shell. It stops short of explicitly distinguishing itself from the sibling exec_python, which is a real ambiguity given that several example binaries are Python tooling.

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?

Usage is only implied: the allowlist and 'shell=False' framing tell the agent this is for pre-approved tooling, but there is no explicit when-to-use/when-not statement and no named alternative such as exec_python or exec_command's relationship to sandbox_inspect_policy. An agent must infer the routing decision.

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