Skip to main content
Glama

execute

Run privileged commands or pipelines locally or on remote hosts after terminal approval; the call blocks until a human responds and returns per-stage output and exit codes.

Instructions

Execute a command (or multi-stage pipeline) on a sudo-proxy host after a human approves it at that host's terminal. Provide argv for a single command or pipeline for piped stages (e.g. [["ls", "/tmp"], ["wc", "-l"]]); host targets a remote daemon started via start_server (omit for localhost). Unprivileged commands on the local machine are refused — use your Bash tool, which applies the same controls. timeout is in milliseconds (max 600000); it defaults to 120000 for privileged commands but is opt-in for unprivileged ones (omitted = wait as long as the daemon needs, so an approved-but-slow command is not falsely timed out). Invisible/format characters (e.g. emoji variation selectors, zero-width or bidi controls) are removed from description before it is shown to the approver. Blocks until the human answers, then returns the final stage's stdout plus per-stage stderr and exit codes. Errors: 'Request denied by user.' if the human declines, a timeout error if unanswered within 60s, and 'sudo-proxy is not running' if the daemon is down — call start_server first.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "execute"
  }
}

Input Schema

NameRequiredDescriptionDefault
envNoEnvironment variables
argvNoCommand as argument array
hostNoTarget host (omit for localhost)
planNoStructured execution plan (advanced; mutually exclusive with `argv`/`pipeline`). A JSON object the daemon executes *directly* — no shell on the privileged path — and renders stage by stage at the approval prompt, so every real binary and per-stage privilege is visible. Prefer this over wrapping commands in `bash -lc`. Nodes are `op`-tagged, e.g. {"op":"exec","argv":["sysctl","-w","vm.mmap_rnd_bits=28"]} (one command); {"op":"pipe","stages":[{"op":"exec",...},{"op":"exec",...}]} (= `|`); {"op":"run","steps":[...]} (≈ `&&`: run in order, stop on first failure); {"op":"seq","steps":[...]} (≈ `;`: run every step regardless of exit); {"op":"alt","steps":[...]} (≈ `||`: run until one succeeds); {"op":"run-as","as":"root","do":{...}} or {"op":"run-as","as":"user","name":"alice","do":{...}}; {"op":"redirect","stream":"stdout","target":{"to":"file","path":"/tmp/o","mode":"truncate"},"do":{...}}; {"op":"setenv","key":"LANG","value":"C","do":{...}}; {"op":"chdir","dir":"/srv","do":{...}}; {"op":"shell","shell":"bash","script":"..."} (explicit opaque escape hatch; an exec whose program is a shell, e.g. ["sh","-c",...], also behind a wrapper such as ["env","sh","-c",...], or an inline-code interpreter such as ["python3","-c",...], is flagged opaque the same way, and a daemon in no_shell mode rejects them all — prefer run/seq/alt/pipe/redirect over a shell). Rules: paths in chdir / redirect / with-stdin-from must be absolute; a stream may be redirected at most once along any path; with-stdin-from is allowed only on the first stage of a pipe; env keys must be shell variable names; run-as names a user, never a `#uid`. Unknown keys are rejected at any depth (`unknown field …`), never silently ignored. Semantics to plan around: a `run` (`&&`) runs its steps in order and STOPS at the first failing step — the earlier steps have already run and their effects are committed, so make early steps idempotent (or put the riskiest / privileged step first) and do not blindly resubmit a failed plan; the response's per-stage exit codes show which steps ran (a skipped step reports exit -1) so you can resume from the failure instead. A `seq` (`;`) instead runs every step regardless of exit (a timeout / spawn failure still aborts). An `alt` (`||`) runs its steps until the first SUCCESS, continuing past failures — use it for `probe || fallback`. A privileged stage placed INSIDE a `pipe` cannot prompt for a sudo password; if it may need one, make it a standalone `run-as` stage rather than a pipe stage (or ensure passwordless sudo on the host).
timeoutNoTimeout in milliseconds, max 600000. For privileged commands the default is 120000. For unprivileged commands the timeout is opt-in: if omitted, the call waits as long as the daemon needs (the 60s approval prompt and the executor's own bound still apply), so an approved-but-slow command is not falsely reported as timed out. Set it explicitly to bound either.
pipelineNoPipeline of commands, each as an argument array. Use this for piped commands like [["ls", "/tmp"], ["wc", "-l"]].
requesterNoOptional self-identification of the AI requester (e.g. your model name), shown to the human approver. It is always shown as `ai:<value>`, so a request through this server is always disclosed as AI-originated.
privilegedNoPrivilege escalation (default: true)
descriptionNoWhat this command does (shown in TUI prompt)
forward_agentNoForward the local SSH agent to the command (unprivileged only). Requires the proxy session to have been started with `forward_agent: true`. Useful for `git clone` of private repos via SSH on a remote host.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.3.0
    • changedInput schema / properties / plan / description
      Previous value: -"Structured execution plan (advanced; mutually exclusive with `argv`/`pipeline`).\nA JSON object the daemon executes *directly* — no shell on the privileged\npath — and renders stage by stage at the approval prompt, so every real\nbinary and per-stage privilege is visible. Prefer this over wrapping\ncommands in `bash -lc`. Nodes are `op`-tagged, e.g.\n{\"op\":\"exec\",\"argv\":[\"sysctl\",\"-w\",\"vm.mmap_rnd_bits=28\"]} (one command);\n{\"op\":\"pipe\",\"stages\":[{\"op\":\"exec\",...},{\"op\":\"exec\",...}]} (= `|`);\n{\"op\":\"run\",\"steps\":[...]} (≈ `&&`: run in order, stop on first failure);\n{\"op\":\"seq\",\"steps\":[...]} (≈ `;`: run every step regardless of exit);\n{\"op\":\"alt\",\"steps\":[...]} (≈ `||`: run until one succeeds);\n{\"op\":\"run-as\",\"as\":\"root\",\"do\":{...}} or {\"op\":\"run-as\",\"as\":\"user\",\"name\":\"alice\",\"do\":{...}};\n{\"op\":\"redirect\",\"stream\":\"stdout\",\"target\":{\"to\":\"file\",\"path\":\"/tmp/o\",\"mode\":\"truncate\"},\"do\":{...}};\n{\"op\":\"setenv\",\"key\":\"LANG\",\"value\":\"C\",\"do\":{...}}; {\"op\":\"chdir\",\"dir\":\"/srv\",\"do\":{...}};\n{\"op\":\"shell\",\"shell\":\"bash\",\"script\":\"...\"} (explicit opaque escape hatch;\nan exec whose program is a shell, e.g. [\"sh\",\"-c\",...], is flagged opaque\nthe same way, and a daemon in no_shell mode rejects both — prefer\nrun/seq/alt/pipe/redirect over a shell).\nRules: paths in chdir / redirect / with-stdin-from must be absolute; a\nstream may be redirected at most once along any path; with-stdin-from is\nallowed only on the first stage of a pipe; env keys must be shell\nvariable names; run-as names a user, never a `#uid`.\nSemantics to plan around: a `run` (`&&`) runs its steps in order and STOPS\nat the first failing step — the earlier steps have already run and their\neffects are committed, so make early steps idempotent (or put the\nriskiest / privileged step first) and do not blindly resubmit a failed\nplan; the response's per-stage exit codes show which steps ran (a skipped\nstep reports exit -1) so you can resume from the failure instead. A `seq`\n(`;`) instead runs every step regardless of exit (a timeout / spawn\nfailure still aborts). An `alt` (`||`) runs its steps until the first\nSUCCESS, continuing past failures — use it for `probe || fallback`. A\nprivileged stage placed INSIDE a `pipe` cannot prompt for a sudo\npassword; if it may need one, make it a standalone `run-as` stage rather\nthan a pipe stage (or ensure passwordless sudo on the host)."New value: +"Structured execution plan (advanced; mutually exclusive with `argv`/`pipeline`).\nA JSON object the daemon executes *directly* — no shell on the privileged\npath — and renders stage by stage at the approval prompt, so every real\nbinary and per-stage privilege is visible. Prefer this over wrapping\ncommands in `bash -lc`. Nodes are `op`-tagged, e.g.\n{\"op\":\"exec\",\"argv\":[\"sysctl\",\"-w\",\"vm.mmap_rnd_bits=28\"]} (one command);\n{\"op\":\"pipe\",\"stages\":[{\"op\":\"exec\",...},{\"op\":\"exec\",...}]} (= `|`);\n{\"op\":\"run\",\"steps\":[...]} (≈ `&&`: run in order, stop on first failure);\n{\"op\":\"seq\",\"steps\":[...]} (≈ `;`: run every step regardless of exit);\n{\"op\":\"alt\",\"steps\":[...]} (≈ `||`: run until one succeeds);\n{\"op\":\"run-as\",\"as\":\"root\",\"do\":{...}} or {\"op\":\"run-as\",\"as\":\"user\",\"name\":\"alice\",\"do\":{...}};\n{\"op\":\"redirect\",\"stream\":\"stdout\",\"target\":{\"to\":\"file\",\"path\":\"/tmp/o\",\"mode\":\"truncate\"},\"do\":{...}};\n{\"op\":\"setenv\",\"key\":\"LANG\",\"value\":\"C\",\"do\":{...}}; {\"op\":\"chdir\",\"dir\":\"/srv\",\"do\":{...}};\n{\"op\":\"shell\",\"shell\":\"bash\",\"script\":\"...\"} (explicit opaque escape hatch;\nan exec whose program is a shell, e.g. [\"sh\",\"-c\",...], also behind a\nwrapper such as [\"env\",\"sh\",\"-c\",...], or an inline-code interpreter\nsuch as [\"python3\",\"-c\",...], is flagged opaque the same way, and a\ndaemon in no_shell mode rejects them all — prefer\nrun/seq/alt/pipe/redirect over a shell).\nRules: paths in chdir / redirect / with-stdin-from must be absolute; a\nstream may be redirected at most once along any path; with-stdin-from is\nallowed only on the first stage of a pipe; env keys must be shell\nvariable names; run-as names a user, never a `#uid`. Unknown keys are\nrejected at any depth (`unknown field …`), never silently ignored.\nSemantics to plan around: a `run` (`&&`) runs its steps in order and STOPS\nat the first failing step — the earlier steps have already run and their\neffects are committed, so make early steps idempotent (or put the\nriskiest / privileged step first) and do not blindly resubmit a failed\nplan; the response's per-stage exit codes show which steps ran (a skipped\nstep reports exit -1) so you can resume from the failure instead. A `seq`\n(`;`) instead runs every step regardless of exit (a timeout / spawn\nfailure still aborts). An `alt` (`||`) runs its steps until the first\nSUCCESS, continuing past failures — use it for `probe || fallback`. A\nprivileged stage placed INSIDE a `pipe` cannot prompt for a sudo\npassword; if it may need one, make it a standalone `run-as` stage rather\nthan a pipe stage (or ensure passwordless sudo on the host)."
  2. Changed2 schema fields changedv1.2.2
    • changedInput schema / properties / plan / description
      Previous value: -"Structured execution plan (advanced; mutually exclusive with `argv`/`pipeline`).\nA JSON object the daemon executes *directly* — no shell on the privileged\npath — and renders stage by stage at the approval prompt, so every real\nbinary and per-stage privilege is visible. Prefer this over wrapping\ncommands in `bash -lc`. Nodes are `op`-tagged, e.g.\n{\"op\":\"exec\",\"argv\":[\"sysctl\",\"-w\",\"vm.mmap_rnd_bits=28\"]} (one command);\n{\"op\":\"pipe\",\"stages\":[{\"op\":\"exec\",...},{\"op\":\"exec\",...}]} (= `|`);\n{\"op\":\"run\",\"steps\":[...]} (≈ `&&`: run in order, stop on first failure);\n{\"op\":\"seq\",\"steps\":[...]} (≈ `;`: run every step regardless of exit);\n{\"op\":\"alt\",\"steps\":[...]} (≈ `||`: run until one succeeds);\n{\"op\":\"run-as\",\"as\":\"root\",\"do\":{...}} or {\"op\":\"run-as\",\"as\":\"user\",\"name\":\"alice\",\"do\":{...}};\n{\"op\":\"redirect\",\"stream\":\"stdout\",\"target\":{\"to\":\"file\",\"path\":\"/tmp/o\",\"mode\":\"truncate\"},\"do\":{...}};\n{\"op\":\"setenv\",\"key\":\"LANG\",\"value\":\"C\",\"do\":{...}}; {\"op\":\"chdir\",\"dir\":\"/srv\",\"do\":{...}};\n{\"op\":\"shell\",\"shell\":\"bash\",\"script\":\"...\"} (explicit opaque escape hatch).\nRules: paths in chdir / redirect / with-stdin-from must be absolute; a\nstream may be redirected at most once along any path; with-stdin-from is\nallowed only on the first stage of a pipe; env keys must be shell\nvariable names; run-as names a user, never a `#uid`.\nSemantics to plan around: a `run` (`&&`) runs its steps in order and STOPS\nat the first failing step — the earlier steps have already run and their\neffects are committed, so make early steps idempotent (or put the\nriskiest / privileged step first) and do not blindly resubmit a failed\nplan; the response's per-stage exit codes show which steps ran (a skipped\nstep reports exit -1) so you can resume from the failure instead. A `seq`\n(`;`) instead runs every step regardless of exit (a timeout / spawn\nfailure still aborts). An `alt` (`||`) runs its steps until the first\nSUCCESS, continuing past failures — use it for `probe || fallback`. A\nprivileged stage placed INSIDE a `pipe` cannot prompt for a sudo\npassword; if it may need one, make it a standalone `run-as` stage rather\nthan a pipe stage (or ensure passwordless sudo on the host)."New value: +"Structured execution plan (advanced; mutually exclusive with `argv`/`pipeline`).\nA JSON object the daemon executes *directly* — no shell on the privileged\npath — and renders stage by stage at the approval prompt, so every real\nbinary and per-stage privilege is visible. Prefer this over wrapping\ncommands in `bash -lc`. Nodes are `op`-tagged, e.g.\n{\"op\":\"exec\",\"argv\":[\"sysctl\",\"-w\",\"vm.mmap_rnd_bits=28\"]} (one command);\n{\"op\":\"pipe\",\"stages\":[{\"op\":\"exec\",...},{\"op\":\"exec\",...}]} (= `|`);\n{\"op\":\"run\",\"steps\":[...]} (≈ `&&`: run in order, stop on first failure);\n{\"op\":\"seq\",\"steps\":[...]} (≈ `;`: run every step regardless of exit);\n{\"op\":\"alt\",\"steps\":[...]} (≈ `||`: run until one succeeds);\n{\"op\":\"run-as\",\"as\":\"root\",\"do\":{...}} or {\"op\":\"run-as\",\"as\":\"user\",\"name\":\"alice\",\"do\":{...}};\n{\"op\":\"redirect\",\"stream\":\"stdout\",\"target\":{\"to\":\"file\",\"path\":\"/tmp/o\",\"mode\":\"truncate\"},\"do\":{...}};\n{\"op\":\"setenv\",\"key\":\"LANG\",\"value\":\"C\",\"do\":{...}}; {\"op\":\"chdir\",\"dir\":\"/srv\",\"do\":{...}};\n{\"op\":\"shell\",\"shell\":\"bash\",\"script\":\"...\"} (explicit opaque escape hatch;\nan exec whose program is a shell, e.g. [\"sh\",\"-c\",...], is flagged opaque\nthe same way, and a daemon in no_shell mode rejects both — prefer\nrun/seq/alt/pipe/redirect over a shell).\nRules: paths in chdir / redirect / with-stdin-from must be absolute; a\nstream may be redirected at most once along any path; with-stdin-from is\nallowed only on the first stage of a pipe; env keys must be shell\nvariable names; run-as names a user, never a `#uid`.\nSemantics to plan around: a `run` (`&&`) runs its steps in order and STOPS\nat the first failing step — the earlier steps have already run and their\neffects are committed, so make early steps idempotent (or put the\nriskiest / privileged step first) and do not blindly resubmit a failed\nplan; the response's per-stage exit codes show which steps ran (a skipped\nstep reports exit -1) so you can resume from the failure instead. A `seq`\n(`;`) instead runs every step regardless of exit (a timeout / spawn\nfailure still aborts). An `alt` (`||`) runs its steps until the first\nSUCCESS, continuing past failures — use it for `probe || fallback`. A\nprivileged stage placed INSIDE a `pipe` cannot prompt for a sudo\npassword; if it may need one, make it a standalone `run-as` stage rather\nthan a pipe stage (or ensure passwordless sudo on the host)."
    • addedInput schema / properties / requester
      Added value: +{
      +  "default": null,
      +  "description": "Optional self-identification of the AI requester (e.g. your model\nname), shown to the human approver. It is always shown as `ai:<value>`,\nso a request through this server is always disclosed as AI-originated.",
      +  "nullable": true,
      +  "type": "string"
      +}
  3. Changed1 schema field changedv1.2.1
    • addedInput schema / properties / plan
      Added value: +{
      +  "default": null,
      +  "description": "Structured execution plan (advanced; mutually exclusive with `argv`/`pipeline`).\nA JSON object the daemon executes *directly* — no shell on the privileged\npath — and renders stage by stage at the approval prompt, so every real\nbinary and per-stage privilege is visible. Prefer this over wrapping\ncommands in `bash -lc`. Nodes are `op`-tagged, e.g.\n{\"op\":\"exec\",\"argv\":[\"sysctl\",\"-w\",\"vm.mmap_rnd_bits=28\"]} (one command);\n{\"op\":\"pipe\",\"stages\":[{\"op\":\"exec\",...},{\"op\":\"exec\",...}]} (= `|`);\n{\"op\":\"run\",\"steps\":[...]} (≈ `&&`: run in order, stop on first failure);\n{\"op\":\"seq\",\"steps\":[...]} (≈ `;`: run every step regardless of exit);\n{\"op\":\"alt\",\"steps\":[...]} (≈ `||`: run until one succeeds);\n{\"op\":\"run-as\",\"as\":\"root\",\"do\":{...}} or {\"op\":\"run-as\",\"as\":\"user\",\"name\":\"alice\",\"do\":{...}};\n{\"op\":\"redirect\",\"stream\":\"stdout\",\"target\":{\"to\":\"file\",\"path\":\"/tmp/o\",\"mode\":\"truncate\"},\"do\":{...}};\n{\"op\":\"setenv\",\"key\":\"LANG\",\"value\":\"C\",\"do\":{...}}; {\"op\":\"chdir\",\"dir\":\"/srv\",\"do\":{...}};\n{\"op\":\"shell\",\"shell\":\"bash\",\"script\":\"...\"} (explicit opaque escape hatch).\nRules: paths in chdir / redirect / with-stdin-from must be absolute; a\nstream may be redirected at most once along any path; with-stdin-from is\nallowed only on the first stage of a pipe; env keys must be shell\nvariable names; run-as names a user, never a `#uid`.\nSemantics to plan around: a `run` (`&&`) runs its steps in order and STOPS\nat the first failing step — the earlier steps have already run and their\neffects are committed, so make early steps idempotent (or put the\nriskiest / privileged step first) and do not blindly resubmit a failed\nplan; the response's per-stage exit codes show which steps ran (a skipped\nstep reports exit -1) so you can resume from the failure instead. A `seq`\n(`;`) instead runs every step regardless of exit (a timeout / spawn\nfailure still aborts). An `alt` (`||`) runs its steps until the first\nSUCCESS, continuing past failures — use it for `probe || fallback`. A\nprivileged stage placed INSIDE a `pipe` cannot prompt for a sudo\npassword; if it may need one, make it a standalone `run-as` stage rather\nthan a pipe stage (or ensure passwordless sudo on the host)."
      +}
  4. Changed1 schema field changedv1.2.0
    • changedInput schema / properties / timeout / description
      Previous value: -"Timeout in milliseconds (default: 120000, max: 600000)"New value: +"Timeout in milliseconds, max 600000. For privileged commands the default\nis 120000. For unprivileged commands the timeout is opt-in: if omitted,\nthe call waits as long as the daemon needs (the 60s approval prompt and\nthe executor's own bound still apply), so an approved-but-slow command is\nnot falsely reported as timed out. Set it explicitly to bound either."
  5. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses that the call blocks until a human answers, the 60s approval window, the 600000ms timeout ceiling and its differing default vs opt-in semantics, that invisibles are stripped from `description` before display, and that partial `run` steps are already committed. It even flags the pipe-stage limitation that a privileged stage inside a pipe cannot prompt for a sudo password, plus the exact error strings returned on denial, timeout, and daemon-down.

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?

The critical constraints — approval requirement, argv-vs-pipeline, refusal of unprivileged local commands — are front-loaded in the first two sentences, and the return shape and error strings are grouped at the end. It is a single dense paragraph with some repeated content (the timeout rule appears in both description and schema) and long run-on clauses, but almost every sentence earns its place for a tool with this much hidden behavior.

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 10-parameter tool with nested `plan` objects and no output schema, the description supplies the missing return contract ('final stage's stdout plus per-stage stderr and exit codes'), including how skipped steps report exit -1 so a failed plan can be resumed rather than resubmitted. The approval interaction, denial/timeout failure modes, and privilege-prompt caveats cover everything an agent needs to call this safely.

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, and the description earns an increment by adding meaning the schema does not: `argv` and `pipeline` are presented as exclusive alternatives for expressing one command, `host` is tied to a daemon started via `start_server` (omit for localhost), and `description` is documented as an approver-facing field subject to character sanitization. It does repeat the `timeout` semantics already spelled out in the schema, which caps it below 5.

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 concrete verb (execute a command or multi-stage pipeline) on a concrete resource (sudo-proxy host) and immediately distinguishes the scope: it requires human approval at the host terminal, and unprivileged local commands are refused in favor of the agent's Bash tool. An agent can tell it apart from `start_server`, `status`, and its own shell without opening the schema.

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?

Explicit routing is given for the main ambiguity: use `argv` for one command, `pipeline` for piped stages, `plan` over `bash -lc` for anything privileged, and use Bash instead for unprivileged local commands. It also names the precondition ('call start_server first' if 'sudo-proxy is not running'), which is the key when-to-use dependency among the siblings.

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

Deploy Server

Other Tools