browser_execute_js
Run JavaScript code in the context of a browser page to manipulate elements, extract information, or perform actions.
Instructions
Execute JavaScript code in the page context.
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": "browser_execute_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | The session ID | |
| script | Yes | JavaScript code to execute | |
| args | No | JSON array of arguments to pass to the script (accessible via arguments[]) | [] |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |