execute_browser_script
Run JavaScript code in an active browser session to manipulate web pages, extract data, or interact with DOM and browser APIs.
Instructions
[LEGACY] Execute JavaScript in the browser context. Use interact_with_page instead.
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": {
"session_id": "<session_id>",
"script": "<script>"
},
"name": "execute_browser_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Browser session ID to execute script in. Session must already exist | |
| script | Yes | JavaScript code to execute in the browser context. Can access DOM, window object, and browser APIs. Use return statement to return values | |
| args | No | Arguments to pass to the script. Will be available as function parameters in the script execution context |