Skip to main content
Glama

Run a program or agent

herdr_run

Starts a program or coding agent in a persistent local or remote terminal, runs argv or a shell line, and sends an initial task to agents; returns the terminal address for follow-up control.

Instructions

Start a program in a new terminal that stays alive. argv runs as given; line runs in the shell; neither opens that machine's shell. If argv[0] names a template (see herdr_templates), its command starts and its body plus task are sent as the first message once the agent is ready. For a plain agent, task is typed as its first message once it is ready. Agents: always background=true, a name, and the whole task up front. Programs: background=false waits for exit (up to timeout) and returns its output in output and how it ended in wait. Returns the terminal (address is what you use afterwards) and, with a task, first_message.sent.

Input Schema

NameRequiredDescriptionDefault
onNoAnother machine (see herdr_machines); default: this one.
rmNoRemove the terminal right after it exits.
cwdNoWorking directory. Default: the core's; on another machine, its home.
envNoEnvironment on top of the core's.
argvNoProgram and arguments, or a template name.
keepNoReplace a lost program with a shell in place (never re-run).
lineNoA shell line instead of argv (`cd app && npm test`).
nameNoUnique among live terminals: 1-32 of a-z 0-9 - _ .
taskNoThe agent's first message (a template's task, or typed once an agent is ready).
labelsNoFree-form labels. herdr.space=<id> shows it in the window.
timeoutNoSeconds before the wait checks in, leaving it running (default 180).
backgroundNoReturn as soon as it runs (default true). False: wait like a shell and include its output.
outlive_parentNoKeep running when the caller's terminal ends.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/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 so: lifecycle ('stays alive'), execution semantics ('argv runs as given; line runs in the shell; neither opens that machine's shell'), template task timing ('sent as the first message once the agent is ready'), default wait/timeout behavior, and what is returned (terminal address, first_message.sent, output/wait for background=false).

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 action, and nearly every clause carries distinct information — the agents/programs split and the return-value note are well placed at the end. Phrasing is telegraphic in spots ('argv runs as given', 'neither opens that machine's shell'), which trades a little clarity for density.

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 13-parameter, zero-required, mutation-style tool with no output schema and no annotations, the description supplies the launch model, the agent-vs-program decision, default timeout/wait behavior, and the return shape. Nothing needed to call it 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 baseline is 3; the description adds real meaning beyond it by contrasting argv and line execution, tying background to the timeout wait, and explaining when task is delivered. It does not cover the less obvious flags (rm, keep, outlive_parent, labels), which are left entirely to 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 and resource ('Start a program in a new terminal that stays alive') and immediately distinguishes the two launch modes (argv vs line) plus the template case referencing herdr_templates. An agent can tell this apart from herdr_exec or herdr_send without opening another schema.

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?

Gives explicit per-case guidance: 'Agents: always background=true, a name, and the whole task up front' versus 'Programs: background=false waits for exit'. It also routes to herdr_templates and herdr_machines. It stops short of naming an explicit alternative tool (e.g. herdr_exec) or a when-not-to-use condition, so not a 5.

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