page_eval
Evaluate a JavaScript expression in the live page and return its value directly, skipping network and console activity. A bounded timeout prevents scripts from running indefinitely.
Instructions
Evaluate a JS expression in the page and return its value directly (no network/console delta). Use this for a quick, standalone read (e.g. "document.title"). If you also want the network/console/url side-effects the expression may cause, use page_observe with {action:{kind:"eval"}} instead. Bounded: an expression that runs or waits longer than timeoutMs (default 15000ms) is stopped — a busy loop is terminated so the page stays usable; a never-settling promise is abandoned.
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": {
"expression": "<expression>"
},
"name": "page_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | No | ||
| timeoutMs | No | time budget in ms (default 15000, max 60000) | |
| expression | Yes |