Skip to main content
Glama

run_snippet

Starts a saved snippet on one or more granted hosts, returns a runId immediately, and pauses for user approval before executing the command.

Instructions

Starts a snippet (see list_snippets) on one or more hosts as a one-step run with a 60 second timeout, and returns at once with a runId; the run goes on in ShellVibe. Every call pauses for the user to approve it in a window that shows the command, the hosts and the values: no policy mode or earlier approval skips this. For a quick read on one host, run_command is the lighter tool, and the only one a read only host allows. Every host must be visible to you and already granted (request_host_access first, or you get HOST_ACCESS_REQUIRED), and not read only: a host whose maxMode or grant is readonly refuses with POLICY_DENIED. Pass only non-secret variables, as plain values (letters, digits, spaces and _-.,:/@%+=~^; no shell syntax); a secret variable is typed by the user in the approval window, and passing one is rejected. Required variables that are missing are reported before the user is asked anything. One run at a time: while another is in progress you get RUNBOOK_BUSY. Follow the run with get_runbook_run; stop it with cancel_runbook_run. An approval step in the runbook waits for the user to press Continue in ShellVibe: you cannot continue it.

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": {
      "snippetId": "<snippetId>",
      "hostIds": "<hostIds>"
    },
    "name": "run_snippet"
  }
}

Input Schema

NameRequiredDescriptionDefault
hostIdsYesThe hosts to run it on: ids from list_hosts that you have been granted access to.
strategyNo"parallel" (default) runs several hosts at once; "rolling" runs one host at a time and stops at the first failure, leaving the rest unstarted: use it for a canary.
snippetIdYesThe id of the snippet, from list_snippets.
variablesNoValues for the non-secret variables, by name. A variable with a default may be left out.
concurrencyNoWith "parallel": how many hosts at once. Defaults to 4.
descriptionNoOne short sentence for the user: what this does and why. Shown in the approval window next to the exact command, which is what the user judges; it does not change what is allowed. Recommended for chained or long commands.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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, the description carries the full burden and does: it discloses asynchronous behavior (returns immediately with a runId, work continues in ShellVibe), an unconditional user approval gate that no policy mode or prior approval can skip, single-run concurrency ("One run at a time... RUNBOOK_BUSY"), the non-continuable approval step, and named failure codes (HOST_ACCESS_REQUIRED, POLICY_DENIED). These are exactly the traits an agent cannot learn from structured fields here.

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 what the tool does and the immediate return shape, and nearly every sentence carries an operational constraint. It is a single dense block with no line breaks, so the error codes and the async/approval facts sit in a wall of text that takes effort to parse.

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 an execution tool with no annotations and no output schema, the definition covers invocation, the human approval model, concurrency limits, variable typing rules, error codes, and the follow-up/stop path. There is no output schema, so the returned runId is explained inline, and nothing an agent needs to call this correctly is missing.

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. The description nonetheless adds meaning the schema does not: variables must be non-secret and plain (character set given, no shell syntax), a secret variable is typed by the user in the approval window and "passing one is rejected", and missing required variables are reported before the user is prompted. That is real behavioral semantics for the variables object rather than a restatement.

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?

"Starts a snippet (see list_snippets) on one or more hosts as a one-step run with a 60 second timeout, and returns at once with a runId" gives a specific verb, resource, timing model, and return value. It explicitly distinguishes itself from run_command ("the lighter tool" for a quick read on one host) and from the runbook tools, so an agent can pick it without opening a 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?

It names the alternative and the condition that selects it ("For a quick read on one host, run_command is the lighter tool, and the only one a read only host allows"), states prerequisites ("request_host_access first"), and states exclusions (read-only hosts, read-only grants, secret variables). Follow-up and stop paths are also named (get_runbook_run, cancel_runbook_run).

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