Skip to main content
Glama

Wait on a terminal

herdr_wait

Waits until a program or agent reports idle/done/blocked/error, exits, or prints specified output; replaces sleep/polling, and timeouts are check-ins to wait again.

Instructions

Wait until a program is not working (an agent reports idle/done/blocked/error, or a program exits), or with output, until it prints that text. Use it instead of sleeping or polling. A timeout is a check-in (ended=false), not a failure: wait again. children=all waits until none of the caller's children is working; children=any returns on the next child's news.

Input Schema

NameRequiredDescriptionDefault
outputNoFor programs: end when output printed after the wait starts contains this text.
timeoutNoSeconds before the wait checks in, leaving it running (default 180).
childrenNo
terminalNoThe terminal; with children, whose children (default: the caller).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/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 on the surprising part: a timeout does not fail, it returns ended=false and the caller should wait again. It also discloses children=all vs any semantics. It says nothing about permissions, whether concurrent waits or nested waits are safe, or what a returned payload otherwise contains beyond the ended flag.

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?

Tight and front-loaded: the primary completion condition comes first, then modes, then the timeout contract, then children. A few phrases are dense to the point of obscurity, e.g. "returns on the next child's news", which costs a bit of clarity.

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?

Four optional params, no output schema, no annotations — the description covers the wait conditions, timeout contract, output matching, and children scope, which is nearly everything needed to call it. Minor gaps remain on error cases (invalid terminal) and on what else the result contains besides ended.

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?

At 75% schema coverage the baseline would be 3, but the description adds real meaning for the undocumented `children` enum (all = wait for every child to stop working, any = return on the next child event) and clarifies whose children are waited on by default. That fills the schema's one genuine gap.

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?

States a specific verb and precise completion conditions: agent reports idle/done/blocked/error, program exit, or (with `output`) text appearing. The two wait modes are clearly delineated. It does not name a sibling such as herdr_status or herdr_get to contrast with, so an agent must infer the boundary itself.

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?

"Use it instead of sleeping or polling" plus the explicit note that a timeout is a check-in (ended=false) and that you should wait again gives strong operational guidance, including the retry loop. What's missing is when not to use it or which sibling to choose instead.

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