browser_eval
Evaluates a JavaScript expression in the active page and returns its JSON-serializable result, awaiting promises up to a timeout. Use it to extract page data or run in-page logic with the current session.
Instructions
Run a JavaScript expression in the active page and return its JSON-serializable result. Promises are awaited (timeout ms, default 10000). Runs with the page's privileges, including any logged-in session: only run code you wrote or understand.
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": "browser_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | Max ms to await a promise (default 10000) | |
| expression | Yes | JavaScript expression |