Skip to main content
Glama

Run a command

exec
Destructive

Run a shell command (bash) in the project's preview workspace, in /workspace by default, as the project's user, with DATABASE_URL and the preview secrets set. Use it for installs, builds, tests, scripts and git. Waits up to timeout seconds (default 60, max 300); with background: true (or a longer timeout) it returns a job id at once and the output is followed with the job tool. Processes the command leaves running are ended when it finishes: long-running servers belong in services.json (service tool).

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

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory, e.g. /workspace/app.
commandYes
projectYesProject slug or id.
timeoutNoSeconds before the command is stopped: default 60, or 3600 with background.
read_onlyNotrue for a command that only looks (ls, grep, git log, cat): it runs while another of the user's AIs is working here, without holding the project. It isn't enforced: never use it for a command that changes anything.
backgroundNo
idempotency_keyNoAny unique string; repeating a call with the same key does not repeat its effect.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Beyond the destructive/openWorld annotations it discloses real behavior: runs as the project's user with DATABASE_URL and preview secrets set, cwd defaults to /workspace, and leftover processes are killed at completion. It also warns that read_only 'isn't enforced'. Minor loss: it says 'max 300' for timeout while the schema allows 3600, and it never mentions idempotency_key.

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?

Dense and front-loaded: execution context first, then intended uses, then timeout/background semantics, then the process-cleanup warning. It is one long run-on block rather than separated sentences, which costs a bit of scanability.

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?

No output schema exists, and the description states that background calls return a job id, but it never says what a foreground call returns (stdout/stderr, exit code) — the most important missing piece for an agent. For a destructive arbitrary-command tool, that gap is notable though partly offset by the environment and process-lifecycle detail.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 71% schema coverage the baseline is mid-range, and the description adds genuine meaning: default and background timeouts, the job-id return behavior for background calls, and the read_only caveat that it is unprotected and must not be used for mutations. The idempotency_key parameter is left entirely undocumented.

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 a shell command (bash) in the project's preview workspace') plus the execution identity, default directory, and injected environment. It also distinguishes itself from the 'job' and 'service' siblings by naming the cases that belong to them.

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?

Gives positive guidance ('installs, builds, tests, scripts and git') and explicit exclusions ('long-running servers belong in services.json (service tool)'), plus the background/timeout path for long work. This is close to a full when/when-not/alternative map.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources