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
| Name | Required | Description | Default |
|---|---|---|---|
| stages_json | Yes | ||
| working_dir | Yes | ||
| __mcp_response_mode | No | content |