Skip to main content
Glama

订阅实时事件

events_subscribe

Subscribe to live browser console, network, error, navigation, tab, performance, and frame events, returning a subscription ID for later polling or blocking consumption.

Instructions

订阅实时事件流:所有新发生的 console 输出、网络请求(请求/响应/完成/失败)、异常、导航、标签页增减、性能指标采样与页面画面帧都会即时进入该订阅。返回 subscriptionId,之后用 events_wait(阻塞等待)或 events_read(立即取)消费。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pushNo是否主动向客户端推送通知,默认 notification(若客户端不支持会自动退化为轮询)
levelNoconsole 级别过滤,如 ["error","warn"]
bufferNo保留的最大事件数,默认 500(画面帧订阅默认 40)
framesNo订阅页面实时画面(Page.startScreencast),可配置画质与帧率
searchNo关键字过滤,命中 URL / 文本 / 载荷
channelsNo通道:console / network / error / navigation / target / metric / frame,省略表示全部
targetIdNo只看某个标签页
maxEventsNo匹配到这么多条后自动退订
errorsOnlyNo只看错误与失败请求
maxDurationMsNo持续这么久后自动退订
performanceSampleMsNo每隔多少毫秒采样一次性能指标并产出 metric 事件

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses the return value (subscriptionId) and that events arrive immediately, but it omits lifecycle behavior such as auto-unsubscribe, buffer limits, and the push/notification fallback to polling (which live only in the schema). No auth or rate-limit context is provided.

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?

Two sentences, front-loaded with the core action and scope, then the return/consumption workflow. The enumeration of event types is somewhat long but earns its place by defining scope; no filler.

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 no-output-schema, 11-param subscription tool, the description supplies the critical missing piece (it returns subscriptionId and how to consume it) plus the event scope. It is fairly complete, though it leaves auto-unsubscribe/buffer semantics and push fallback to the schema rather than surfacing them.

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 schema already documents all 11 params (push, level, buffer, frames, channels, etc.). The description adds only a general list of what events exist, which maps loosely to the channels enum but adds no syntax or format detail beyond the schema baseline.

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?

States a specific verb and resource ('订阅实时事件流') and enumerates exactly what flows in (console, network, error, navigation, target, metric, frame). It also names the sibling tools used to consume the subscription, so an agent can distinguish this from events_read/events_wait.

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 defines the workflow clearly: subscribe here, then consume via events_wait (blocking) or events_read (immediate), which effectively routes the agent across siblings. However, it gives no explicit comparison against alternative event-acquisition tools such as recording_start or the individual console_read/network_list/page_errors readers, nor any when-not guidance.

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