Skip to main content
Glama

ssh_run_playbook

Executes a multi-step playbook on a remote host, stops on the first non-zero exit code, and returns a transcript of every step that ran.

Instructions

Execute a multi-step playbook on a remote host. The 'content' field is a multi-line string. Supports structured format with directives: '# @section "Title"' to group steps into sections, '# @desc "description"' for section description, '# @note "text"' for step notes, '# @danger "text"' for danger warnings, and '# @on "command"' for interactive commands (replaces legacy 'expect:'/'answer:' syntax). Legacy format (one command per line with optional 'expect:'/'answer:' pairs) is also supported. Stops on the first non-zero exit code and returns the transcript of every step that ran. Call host_list first — it returns the uid of every host, and that value is what host_id expects. The model must use host_id only; credentials are resolved server-side. The model MUST supply timeout_seconds (1-600) — it is the budget for the WHOLE playbook, each step only gets the time that is left.

Input Schema

NameRequiredDescriptionDefault
contentYesMulti-line playbook body. Supports structured directives (# @section, # @desc, # @note, # @danger, # @on) or legacy expect:/answer: pairs.
host_idYesIdentifier of an existing host: the exact `uid` value returned by `host_list`. Call `host_list` first and pass that value unchanged.
timeout_secondsYesHard timeout in seconds. REQUIRED. The model must estimate an appropriate timeout based on the command's complexity (1-600 seconds). The command is terminated when the timeout expires.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/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 well: it discloses fail-fast semantics (stops on first non-zero exit code), that a transcript of every executed step is returned, and that credentials are handled server-side. It omits any warning that these are arbitrary remote commands with side effects, which is the main residual risk an agent should know about.

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?

Front-loaded with the core purpose, then constraints, then format details; almost every sentence adds operational value. The run of directive definitions is list-like and could be tightened, but it is not padding.

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?

No output schema, but the description states what comes back (transcript of every step that ran), which covers the key unknown. For a 3-param tool with full schema coverage, remaining gaps (transcript shape, partial-failure return structure) are minor.

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 coverage is already 100%, yet the description still adds meaning the schema lacks: timeout_seconds is a budget for the WHOLE playbook with each step consuming the remainder, and host_id must be the exact uid from host_list rather than a hostname. It also expands the content directives (including that @on replaces legacy expect:/answer:) well beyond the schema's one-line summary.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb and resource ("Execute a multi-step playbook on a remote host"), which implicitly separates it from ssh_run_command (single command) and ssh_run_interactive. It never names those siblings explicitly, so the differentiation is inferred rather than stated.

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?

Strong prerequisites and constraints: call host_list first, use only host_id, credentials resolved server-side, timeout_seconds is mandatory (1-600). It lacks an explicit "use ssh_run_command instead when you only need one command" exclusion, so the when-not side of the routing decision is left implicit.

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