Skip to main content
Glama

Run commands in sequence

run_seq

Run dependent CLI steps in sequence, stopping at the first failure so later build, test, or package steps do not run after an error. Set stopOnError=false to run all steps.

Instructions

Run an ordered list of labeled commands one after another, stopping at the first failure by default. Use for dependent steps (e.g. build then test then package) where order matters and a later step is pointless if an earlier one fails. Unlike batch (parallel), run_seq is sequential and short-circuits; set stopOnError=false to run every step regardless.

Input Schema

NameRequiredDescriptionDefault
stepsNoRequired. Ordered steps to run sequentially
maxLinesNoMax stdout/stderr lines to keep per step. 0 = unlimited.
stopOnErrorNoStop at the first step with a non-zero exit code (default true).

Output Schema

NameRequiredDescriptionDefault
stepsYes
elapsedYesTotal wall-clock time in milliseconds
exitCodeYes0 if every step succeeded, else the first failure's code
failedAtYesIndex of the first failing step, or null if all passed
retainedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.1

TDQS

A4.4/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 load and does disclose the key behavioral traits: sequencing, fail-fast short-circuit, per-step labels in results, and the exact effect of stopOnError=false. It does not mention that individual steps can time out (schema default 30s) or that output is truncated per step, leaving some execution risk unstated for an arbitrary-command tool.

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?

Three sentences, front-loaded with the core behavior, then the decision rule, then the sibling contrast and override. No filler and nothing redundant with the schema restated verbatim.

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?

An output schema exists, so return values needn't be explained, and the 3-parameter schema is fully described. What remains thin is execution-risk context an agent might want for a shell-running tool (timeout per step, output truncation via maxLines), though it is discoverable from the schema.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter including nested step fields is already documented, which sets the baseline at 3. The description reinforces stopOnError's default and semantics but adds no syntax or constraints beyond what the schema says (e.g. non-shell-string command form is only in the 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?

States a specific verb (run) and resource (ordered list of labeled commands) with explicit execution semantics ('one after another, stopping at the first failure'). It also explicitly contrasts with the sibling batch tool, so an agent can distinguish the two without opening either 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?

Gives an explicit when-to-use case ('dependent steps... build then test then package') and a when-to-use-alternative rule ('unlike batch (parallel), run_seq is sequential and short-circuits'). It further tells the agent when to override the default via stopOnError=false.

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