Evaluate JavaScript
evaluateRuns JavaScript in the selected page's main runtime to execute promise-based DOM interactions and return serializable results.
Instructions
Evaluate JavaScript in the selected page's main runtime. Supports promises and mutations, so an expression can install a one-shot DOM event listener and resolve after the user acts. Results must be serializable.
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"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_id | No | Target page id from get_pages; omit to use the selected page | |
| expression | Yes | JavaScript expression or IIFE | |
| await_promise | No |