Skip to main content
Glama

read_python_output

Retrieve output from a Python execution by selecting a stream (combined, stdout, stderr, result, traceback) and specifying a line range. Supports character limits and complete stream retrieval.

Instructions

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

选择与流

execution 的选择规则与 python_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`` 行范围;已确定需要完整消费所选流时省略, 工具会一次返回全部行,无需拆分为多个小范围。
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It explains the line_range format and complete reading behavior, and notes that max_chars only truncates output without altering saved text. However, it does not mention safety, idempotency, or side effects, leaving some gaps.

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?

The description is well-structured with sections for stream selection, line coordinates, and complete reading. It is front-loaded with the purpose. While slightly lengthy, it remains efficient and avoids unnecessary details.

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?

Given no output schema and no annotations, the description covers stream selection and line ranges adequately but does not specify the return format or any error conditions. It is sufficient for basic usage but lacks some contextual details.

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 the baseline is 3. The description adds some value with examples for line_range and clarifies allowed values for stream, but the schema already details each parameter. The added information is helpful but not critical.

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?

The description clearly states the tool reads a specified output stream from an execution. It distinguishes itself from sibling tools like search_python_output by focusing on reading rather than searching, and mentions the selection rules are shared with python_execution_status.

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 implies usage context by referencing the selection rules of python_execution_status and describing complete reading scenarios, but it does not explicitly state when to use this tool versus alternatives like search_python_output. Guidance is implicit rather than explicit.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MichengLiang/loommux'

If you have feedback or need assistance with the MCP directory API, please join our Discord server