Skip to main content
Glama

observe_stream

Launch a long-running command and immediately receive a window ID for live log or event-stream monitoring, then read output by cursor without consuming it.

Instructions

直接启动一条持续输出命令并打开本地滚动观察窗,立即返回 window_id(不等待命令结束)。适用于实时盯日志或持续监控输出(如 tail -f、事件流),配合 read_stream 按游标非破坏回看/翻页/续读,完成后用 close_stream 关闭并回收远端流进程。若需后台起停服务、等待就绪标记并核实进程退出码,请改用 spawn_and_observe + stop_and_verify。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "command": "<command>"
    },
    "name": "observe_stream"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNo窗口显示名称
layerNo目标层名,缺省使用默认层
streamNo流过滤,缺省 both
commandYes由本工具启动并持续观察流式输出的命令(如 'tail -f /var/log/app.log')

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.2
    • addedInput schema / properties / command / description
      Added value: +"由本工具启动并持续观察流式输出的命令(如 'tail -f /var/log/app.log')"
    • addedInput schema / properties / command / minLength
      Added value: +1
  2. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key non-obvious trait: it returns immediately without waiting for command completion, and reads are non-destructive by cursor. It also notes that close_stream reclaims the remote stream process. Remaining gaps are secondary (whether an unclosed window leaks a process, permissions, or limits on concurrent windows).

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?

It is front-loaded with the core action and return value, then lifecycle, then the alternative — a logical order with no filler. It is slightly dense due to multiple clauses, but each sentence contributes routing or lifecycle information.

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?

There is no output schema, and the description covers the return value, the read/close lifecycle, and the correct alternative, which is sufficient for a four-parameter tool. The only shortfall is that the meaning of the layer parameter and the nature of the 'window' remain unstated.

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 restates the intent of 'command' as the streamed command and implies the window context for 'name,' but adds no meaning to 'layer' or the stdout/stderr/both filter beyond what the schema already says.

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 opens with a specific verb+resource pair, 'starts a persistent-output command and opens a local scrolling observation window,' and immediately names the return value (window_id). It explicitly separates itself from spawn_and_observe/stop_and_verify, so an agent can route without opening any sibling 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?

It names concrete use cases (tail -f, event streams), the companion tools to use during and after the call (read_stream by cursor, close_stream to clean up), and an explicit when-not clause with the correct alternative (spawn_and_observe + stop_and_verify for background services needing readiness checks and exit codes).

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