Skip to main content
Glama

实时看会话正在输出什么

piweb_watch_session

Subscribe to a pi coding session's event stream for a specified duration, collecting text, thinking, and tool-call updates and returning accumulated output to show current progress.

Instructions

订阅会话的事件流,在指定秒数内收集正在生成的内容(文本增量、思考增量、工具调用),返回期间累计的文本。适合「它现在跑到哪了」。注意:会话没在运行时订阅会把它拉起成一个空闲进程(等同在 pi-web 打开该会话)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
secondsNo监听时长秒数,默认 30
sessionYes会话 id / 名称
until_idleNo会话跑完就提前结束(最多仍受 seconds 限制),默认 true
include_thinkingNo是否也收集思考增量,默认 false

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only say readOnlyHint=false / openWorldHint=true; the description explains why it is not a pure read by disclosing that subscribing to a non-running session spins it up as an idle process, equivalent to opening it in pi-web. It also discloses exactly what is captured during the window and what is returned (accumulated text), which is the key behavioral 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.

Conciseness5/5

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

Three sentences, zero padding: core action first, then the usage cue, then the side-effect warning last. The ordering is front-loaded and each sentence carries distinct information.

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 still states the return value (accumulated text over the window), explains the collection modes, and warns about the process-start side effect. Nothing an agent needs to invoke this 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 four parameters (seconds, session, until_idle, include_thinking) are already documented in the schema. The description loosely echoes the collection modes ('思考增量' maps to include_thinking) but adds no syntax, default, or interaction detail beyond the schema, so the baseline 3 applies.

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 names a specific verb and resource (subscribe to a session's event stream and collect generated content for N seconds) and states the scope of what is captured (text deltas, thinking deltas, tool calls). The 'where is it now' framing clearly separates it from static siblings like piweb_get_session or piweb_status.

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?

It gives a concrete when-to-use cue ('适合「它现在跑到哪了」'), which points the agent at live monitoring rather than a snapshot. It does not, however, name an explicit alternative (e.g., piweb_get_session for a one-shot read, piweb_wait_for_reply for blocking) or state when not to use it.

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