evaluate_js
Execute JavaScript in the browser page to return the last expression's value, with top-level await support for async operations.
Instructions
Run JavaScript in the page; top-level await works, and the last expression's value is returned.
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": "evaluate_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | No | ||
| expression | Yes | JavaScript. | |
| awaitPromise | No | Default true. | |
| returnByValue | No | JSON value (default true); false gives a short description (Chromium only). |