execute_javascript
Run JavaScript code directly in a browser page context to inspect or modify the DOM, read variables, or trigger page actions. Optionally target a specific tab by ID.
Instructions
Execute JavaScript 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": {
"code": "<code>"
},
"name": "execute_javascript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript code to execute | |
| tabId | No | Tab ID (optional) |