Skip to main content
Glama

read_output

Read a specified output stream from an execution, choosing from combined, stdout, stderr, result, or traceback. Optionally filter by line range and cap the number of characters returned.

Instructions

读取一个 execution 的指定输出流。

选择与流

execution 的选择规则与 execution_status 相同。stream 只能为 combinedstdoutstderrresulttraceback

行坐标

line_range 使用 start:stop。正数端点是从 1 开始的流行号, stop 包含在范围内;端点可省略,负数端点从所选流尾部计数。:10 读取前十行,-10: 读取后十行,3:3 只读取第三行。

完整读取

调用者已确定需要完整消费所选流时,省略 line_range。工具会在一次响应 中返回全部行,无需把阅读拆成连续小范围。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
streamNo输出流;默认 ``combined``,其余值为 ``stdout``、``stderr``、 ``result`` 与 ``traceback``。combined
executionNo要读取的正整数执行编号。省略时使用当前记录,随后 使用最近记录。
max_charsNo每个返回行允许显示的最大字符数;必须为正数。超出 部分只在响应中裁切,不改变已保存文本或行坐标。
line_rangeNo``start:stop`` 行范围;已确定需要完整消费所选流时省略, 工具会一次返回全部行,无需拆分为多个小范围。

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.13

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the truncation behavior of max_chars (only in response, does not alter saved text or line coordinates). It does not mention any other side effects, permissions, or that it is a read-only operation, so transparency is partial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured into sections (选择与流, 行坐标, 完整读取) which aids readability. However, some repetition occurs (e.g., line_range explanation appears both in the main text and in the parameter schema). It is not overly verbose but could be more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description conveys that the tool returns lines of output (via '返回行' and truncation context) and explains how to request subsets. Since there is no output schema, this explanation is sufficient for basic usage, but it does not detail the exact return structure (e.g., whether it returns a list, the format of each line). Overall, it is complete enough for an agent to call it correctly.

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?

The schema covers all 4 parameters with descriptions, achieving 100% coverage. The tool description repeats some parameter details but does not add significant new meaning beyond the schema. Baseline 3 is appropriate given the high schema coverage.

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 description clearly states the tool's purpose: reading a specified output stream of an execution. The verb '读取' (read) is specific and the resource 'execution 的输出流' is unambiguous. It does not explicitly differentiate from sibling tools like search_output, but the core purpose is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage guidance, such as how to select the execution (rules same as execution_status) and when to omit line_range for full consumption. However, it does not explicitly mention when to use this tool over alternatives like search_output, leaving some ambiguity for an agent.

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