Skip to main content
Glama

Shell run

shell_run
Destructive

Executes shell commands in the workspace for builds, tests, git, and package installs, returning a background run ID or blocking for stdout/stderr on short commands.

Instructions

Run a shell command in the workspace (shell, relative_cwd, timeout_s). Default is background: returns run_id, poll shell_status. background=false blocks until exit and returns stdout/stderr. Use when: you build, test, run git or install packages. background=false for short commands you need now. Avoid when: you read or edit files (file tools) or run a tiny JS calculation (execute_js). Output: run_id, kill_key, running, exit_code, timed_out, stdout/stderr (background=false) or stdout_tail/stderr_tail. ok=true only means the call ran; status (completed|failed|running|cancelled) and command_status describe the command. shell_path/shell_kind name the binary that ran it (on Windows bash may be the WSL launcher). approval_required: ask the user to approve, then retry once with approval_id. repeated_failure: the identical invocation already failed; read data.previous.stderr_tail, then change the command or pass retry_failed=true.

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": "shell_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
shellNoDefault: VENIRA_DEFAULT_SHELL, else the host default. pwsh = PowerShell 7+, powershell = 5.1.
reasonNoRequired with override: one-line intent (audit-logged).
commandYesCommand line to run.
dry_runNotrue = evaluate policy only; nothing runs, no approval is created (default false).
overrideNoNamed exception; only works when the operator enabled this exact name in VENIRA_SHELL_OVERRIDES.
timeout_sNoKill the process tree after this many seconds (0/unset = 10 min; fractional ok; capped by VENIRA_SHELL_MAX_TIMEOUT_MS).
backgroundNotrue = background (default): return immediately with run_id. false = foreground: block until the command exits, then return the final stdout/stderr in this call.
secret_envNoStored secret names (secret) injected as env vars, e.g. ["GITHUB_TOKEN"]. Values never appear in the command, audit log or output.
approval_idNoId from approval_required, granted by a human (`data.approval.approve_command` or client elicitation). Retry once.
relative_cwdNoWorking directory inside the workspace (default: workspace root).
retry_failedNotrue = rerun an identical invocation that already failed (default false: refused with repeated_failure and the previous stderr tail).
approval_wait_sNoIf approval is needed, wait up to this many seconds (max 45; fractional ok) for the human, then run in the same call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv4.5.0
    • changedInput schema / properties / background / description
      Previous value: -"1 = background (default): return immediately with run_id. 0 = foreground: block until the command exits, then return the final stdout/stderr in this call."New value: +"true = background (default): return immediately with run_id. false = foreground: block until the command exits, then return the final stdout/stderr in this call."
    • removedInput schema / properties / background / maximum
      Removed value: -1
    • removedInput schema / properties / background / minimum
      Removed value: -0
    • changedInput schema / properties / background / type
      Previous value: -"integer"New value: +"boolean"
    • changedInput schema / properties / dry_run / description
      Previous value: -"1 = evaluate policy only; nothing runs, no approval is created (default 0)."New value: +"true = evaluate policy only; nothing runs, no approval is created (default false)."
    • removedInput schema / properties / dry_run / maximum
      Removed value: -1
    • removedInput schema / properties / dry_run / minimum
      Removed value: -0
    • changedInput schema / properties / dry_run / type
      Previous value: -"integer"New value: +"boolean"
    • changedInput schema / properties / retry_failed / description
      Previous value: -"1 = rerun an identical invocation that already failed (default 0: refused with repeated_failure and the previous stderr tail)."New value: +"true = rerun an identical invocation that already failed (default false: refused with repeated_failure and the previous stderr tail)."
    • removedInput schema / properties / retry_failed / maximum
      Removed value: -1
    • removedInput schema / properties / retry_failed / minimum
      Removed value: -0
    • changedInput schema / properties / retry_failed / type
      Previous value: -"integer"New value: +"boolean"
  2. Addedv4.0.0

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the destructive/openWorld annotations, the description discloses the asynchronous-by-default contract, the full return surface (run_id, kill_key, exit_code, stdout_tail), and the important caveat that ok=true only means the call ran, not that the command succeeded. It also explains the approval_required retry loop and the repeated_failure refusal path with data.previous.stderr_tail, which are non-obvious behaviors an agent would otherwise stumble into.

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?

It is front-loaded with purpose and default behavior, then segmented into Use/Avoid and Output/edge-case blocks, which makes it fast to scan. The opening parenthetical '(shell, relative_cwd, timeout_s)' duplicates schema content and is the only real waste.

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

Completeness5/5

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

For a 12-parameter destructive tool with no output schema, the definition still covers return fields, status semantics, shell binary provenance (Windows bash may be the WSL launcher), and both the approval and repeated-failure recovery paths. Nothing an agent needs to invoke it safely is left unstated.

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 the schema already documents all 12 parameters including override, secret_env, and approval_wait_s. The description's parenthetical parameter list and its background explanation largely restate what the schema says, adding little syntax or format detail beyond it; 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?

The first sentence gives a specific verb and resource ('Run a shell command in the workspace') plus the primary parameter names, and it explicitly distinguishes itself from shell_status (polling) and from the file/JS siblings. An agent can tell immediately what this tool does and which sibling handles the follow-up.

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?

It provides both an explicit 'Use when' (build, test, git, install) and 'Avoid when' (file reads/edits, tiny JS calc), naming the alternatives that should be used instead. It also states the mode-selection rule: background=false for short commands whose output is needed now.

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