Skip to main content
Glama

shell_exec

Run a one-shot shell command with rule-based secret injection while redacting secret values from output and blocking dangerous environment-reading commands.

Instructions

Execute a one-shot shell command with secrets injected per matching rule. Output is redacted: injected secret values never appear in the response. Dangerous commands (env, printenv, export -p, /proc/*/environ, ...) are hard-blocked. There is no free-form env parameter; secrets are only injected by reference via rules.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoworking directory (~ is expanded); default: server cwd
commandYesshell command to execute
profileNooptional profile name for rule matching
extraEnvNonon-secret env vars, keys must be in defaults.extraEnvAllowlist

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses output redaction of injected secret values, hard-blocked command patterns with examples, and the secret-injection model. It still omits exit-status behavior, timeouts, and the side-effect profile of arbitrary command execution, which matter for a mutation-capable tool.

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?

Four tight sentences, front-loaded with the core action and immediately followed by the safety-relevant behavior. No filler or repetition of the tool name.

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?

For a 4-param command-execution tool with no annotations and no output schema, the description covers the safety profile (redaction, hard blocks, env-injection model) that an agent most needs. Remaining gaps are return-shape and failure-mode details, which are minor given the absence of an output schema.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by explaining that secrets cannot be passed as env params and are injected only by rule reference — which is exactly the semantic governing 'profile' and 'extraEnv'. It does not, however, clarify rule/profile matching syntax or allowlist contents.

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 ('Execute') and resource ('shell command') plus a scoping qualifier ('one-shot') that cleanly separates it from the shell_session_* siblings. An agent can distinguish it from shell_proxy_* and session tools without opening any schema.

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

Usage Guidelines4/5

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

The 'one-shot' framing and the explicit constraint that there is no free-form env parameter (secrets only by rule reference) give clear context for when this tool is appropriate. It stops short of naming shell_session_open/send as the alternative for persistent or interactive work, so the routing is implied rather than stated.

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