Skip to main content
Glama
quolu
by quolu

pty_read

Read PTY session output incrementally with token-saving compression, and retrieve final assistant messages when long responses get truncated in the terminal.

Instructions

セッションの出力をトークン削減して読む(既定は前回読取位置からの増分)。削減: 制御文字除去 / 反復圧縮 / head+tail 折りたたみ+復元ヒント+メタ併記。agent_transcript:true は agent session の直近完了ターンの最終 assistant メッセージを公開されたvendor記録から平文で返す。長い回答が screen tail で切れた時の回収用。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rawNo削減せず生テキスト
rtkNo直前コマンド別の自前 reducer(git/grep/pytest 等)で縮約
fullNo増分でなく全文
waitNo完了まで待つ(dead / mark sentinel 自動検出 / until / 出力静止∧シェル復帰 / timeout)
linesNo末尾 N 行のみ
untilNoこの文字列が出たら完了とみなす(既定はリテラル部分一致。`$ ` や `[..]` もそのまま探せる)
screenNo描画済みスクリーン(TUI 向け)
timeoutNowait の最大待ち秒数
line_rangeNo全文からの行範囲 "A:B"
session_idYes
until_regexNountil を正規表現として扱う(既定 false=リテラル部分一致。メタ文字を使いたい時のみ true)
operation_idNoClaude operationの期待ID。agent_transcript:true時だけ指定し、古い別operationの結果を拒否する
agent_transcriptNoagent session の直近完了ターンの最終 assistant メッセージを返す。Claudeはlaunch相関付きStop hook result、他vendorは通常transcriptを使う。長い回答がscreen tailで切れた時の回収用
Behavior4/5

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

No annotations are provided, so the description carries the disclosure burden. It explains token reduction techniques (control character removal, repetition compression, head+tail folding), the incremental read position behavior, and the agent_transcript source and purpose. It does not explicitly state whether reading consumes output, but the incremental position mention implies state tracking. This is substantial contextual information.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the main purpose, and details are concise. Every sentence adds either behavioral context or a specific use case, with no redundant words.

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?

For a tool with 13 parameters and no output schema, the description covers the core behavior, reduction modes, and the special agent_transcript mode. It does not detail every parameter, but the schema covers them. The description provides enough context for an agent to select and use the tool effectively.

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 92%, so the schema already documents most parameters. The description adds value by explaining the agent_transcript parameter's behavior and the default incremental reading (related to 'full'), but it does not systematically elaborate on each parameter beyond that. 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?

The description clearly states the tool reads session output with token reduction, with a specific default behavior (incremental from last read position). It distinguishes itself from sibling tools like pty_send and pty_open by focusing on reading output, and the agent_transcript mode is a distinct sub-purpose.

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?

The description gives clear context: use it to read session output with token reduction, and specifically mentions the recovery use-case for truncated long answers via agent_transcript. It does not explicitly list exclusions or alternatives, but the context is sufficient to infer when to use it.

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/quolu/aiterm-mcp'

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