page.observe
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
| Name | Required | Description | Default |
|---|---|---|---|
| for_ms | No | Total duration. Default 10000. | |
| sample | No | Named JS expressions to evaluate each tick, e.g. {"locked": "!!document.querySelector('.overlay')"}. | |
| every_ms | No | Sampling interval. Default 250. | |
| selector | No | Shorthand for the common case: watch this element text change over time. Use instead of sample. | |
| stop_when | No | JS expression; sampling stops early once it is truthy. | |
| target_id | No | Target handle (tgt_*). Omit for the active page. | |
| browser_id | No | Browser handle (br_*). Omit to use the only running browser, or auto-launch one. |