Skip to main content
Glama

get_program_output

Read-only

Read the last lines a spawned program wrote to stdout and stderr, with running/exit status, to diagnose missing windows or crashes.

Instructions

Read the last lines (40, or lines) a spawned program wrote to stdout and stderr, after a line saying whether it's still running or exited, with its status. It works after the program has exited, until the session stops; for a program spawned more than once, it reads the latest. Use it when a window never comes up or a program seems to have crashed; to wait for a line in a log file, use wait_for line.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
linesNoHow many lines from the end (40)
programYesIts name in the allow list
sessionYesIts name, from start_session

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.1

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint and openWorldHint; the description adds substantive behavior beyond that: output is a status line plus the last 40 lines, stderr and stdout are combined, results persist after exit until session stop, and repeated spawns resolve to the latest instance. This is exactly the lifecycle/ordering context an agent needs.

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?

Information is front-loaded and dense, with no filler sentences; the alternative tool is mentioned last as routing guidance. Slightly awkward phrasing ('after a line saying whether it's still running or exited, with its status') costs a point on readability, but every clause carries content.

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?

With no output schema, the description fully explains the return shape (status line plus trailing log lines), covers the lifecycle edge cases (post-exit reads, repeated spawns), and all parameters are schema-documented. Nothing an agent needs to invoke it correctly is missing.

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 all three parameters are already documented in the schema. The description only confirms the default line count (40) already noted in the schema's lines description, adding no real meaning beyond it. Baseline 3 is appropriate.

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 (read) and resource (last lines a spawned program wrote to stdout/stderr), including the status header line. It explicitly distinguishes itself from the sibling wait_for, so an agent can select it without opening the 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 use case (a window never comes up, or a program seems to have crashed) and names the alternative tool plus the condition that selects it ('to wait for a line in a log file, use wait_for line'). It also notes the tool remains usable after the program exits, until the session stops.

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