Skip to main content
Glama
meomeo-dev

shell-as-mcp

by meomeo-dev

run_safe_command__pipeline

Execute a shell pipeline securely by validating each stage against an allowlist, using subprocess chaining to avoid shell injection and unsafe commands.

Instructions

Execute a safe shell pipeline from structured stage definitions. @remarks Each stage is validated against a command allowlist before execution. The pipeline is assembled using Python subprocess chaining (Popen stdin chains), not via shell eval or bash -c with user-supplied data. Commands are restricted to a safe processing-only allowlist; destructive or network commands are not permitted. Unlike run_safe_command__execute, this tool accepts pipe-connected stage sequences but applies stricter per-stage command validation to compensate. On darwin/arm64, pre-execution auth prefers native Swift+WKWebView and automatically falls back to OSA. @param stages_json JSON array of pipeline stage objects. Each stage must have "command" (string) and "args" (string array). Commands must pass the pipeline allowlist: grep, awk, sed, cut, sort, uniq, wc, head, tail, cat, echo, tr, xargs, find, ls, ps, du, df, date, env, printenv, uname, hostname, id, whoami, pwd, dirname, basename. Example: [{"command":"ps","args":["aux"]},{"command":"grep","args":["python"]}] @param working_dir Absolute working directory shared by all pipeline stages. @param __mcp_response_mode Optional response mode: content (default) or structuredContent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stages_jsonYes
working_dirYes
__mcp_response_modeNocontent
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses the safety model: validation against an allowlist, subprocess chaining via Popen (not shell eval), explicit command allowlist, and prohibition of destructive/network commands. It also notes platform-specific auth behavior (native Swift+WKWebView fallback to OSA on darwin/arm64). These are significant behavioral traits not visible elsewhere.

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?

The description is front-loaded with a one-sentence purpose, followed by structured @remarks and @param blocks. Every sentence adds value: safety implementation, allowlist details, sibling differentiation, and parameter semantics. No filler or repetition; the length is justified by the tool's complexity.

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?

The description is rich in purpose, parameters, and safety behavior, covering most context needed. However, it lacks any statement about return values or output format (e.g., stdout/stderr). Since there is no output schema, this information would complete the picture. Minor gap, but the rest is comprehensive.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate. It does so thoroughly: @param stages_json explains the JSON array structure, required keys, lists valid commands, and gives a concrete example. @param working_dir specifies 'absolute working directory shared by all pipeline stages.' @param __mcp_response_mode explains the enum options. This adds substantial meaning beyond the raw schema.

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 description opens with a specific verb and resource: 'Execute a safe shell pipeline from structured stage definitions.' It clearly distinguishes itself from the sibling tool by stating 'Unlike run_safe_command__execute, this tool accepts pipe-connected stage sequences but applies stricter per-stage command validation to compensate.' This is a clear, specific purpose that differentiates from alternatives.

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 description explicitly names the alternative run_safe_command__execute and notes the key difference (pipe-connected stages vs. presumably single command). It also gives context on when this tool is appropriate (when you need a pipeline of allowlisted commands) and mentions validation and auth behavior. However, it does not explicitly state the inverse condition (e.g., 'use execute for single commands'), so it stops short of a full when/when-not prescription.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/meomeo-dev/shell-as-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server