execute_script
Run arbitrary JavaScript in the active browser tab to inspect or modify page state and return the evaluated result; optionally capture console output and set a timeout.
Instructions
Execute arbitrary JavaScript code in the active browser tab and return the result
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": {
"code": "<code>"
},
"name": "execute_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript expression to evaluate | |
| world | No | Execution world hint (currently accepted but not enforced) | |
| timeoutMs | No | Timeout in milliseconds | |
| captureConsole | No | Capture console output during evaluation |