Skip to main content
Glama

page.observe

Read-only

Samples JavaScript expressions or element text on an interval and returns a timeline with value transitions, letting agents measure UI lock time or when a step appeared without custom polling loops.

Instructions

Sample expressions on an interval and return the timeline plus the transitions between values. Use to measure how long a UI sat locked or when a step actually appeared, instead of hand-rolling a polling loop in js.evaluate.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "page.observe"
  }
}

Input Schema

NameRequiredDescriptionDefault
for_msNoTotal duration. Default 10000.
sampleNoNamed JS expressions to evaluate each tick, e.g. {"locked": "!!document.querySelector('.overlay')"}.
every_msNoSampling interval. Default 250.
selectorNoShorthand for the common case: watch this element text change over time. Use instead of sample.
stop_whenNoJS expression; sampling stops early once it is truthy.
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds the return shape (timeline plus transitions), which is genuinely useful, but it omits that the call blocks for the sampling window (10s default) and says nothing about cost or how many samples are retained. Useful context, but not rich behavioral disclosure.

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?

Two sentences, zero waste, with the core behavior front-loaded before the usage guidance. Every clause earns its place.

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?

With no output schema, the description correctly spends words on the return value (timeline plus transitions), which is the main thing an agent could not otherwise infer. For a 7-parameter, all-optional tool the remaining gaps are minor, since the schema carries the parameter detail and annotations carry the safety profile.

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 every parameter including for_ms, every_ms, sample, selector, stop_when, target_id and browser_id is already documented in the schema. The description adds no syntax, format, or interaction detail (such as selector versus sample precedence) beyond what the schema states, 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?

States a specific verb and resource: sample expressions on an interval, returning a timeline plus transitions between values. It also explicitly distinguishes itself from js.evaluate by framing itself as the alternative to a hand-rolled polling loop, so an agent can tell the two apart without opening either schema.

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?

Gives concrete when-to-use scenarios (measuring how long a UI sat locked, when a step appeared) and names the alternative it replaces (a polling loop in js.evaluate). It stops short of stating when not to use it, e.g. one-shot reads that page.snapshot or page.extract_text would cover, so it is clear but not fully routing.

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

Deploy Server

Other Tools