execute_javascript
Execute JavaScript in the active browser tab to extract web page data, returning results directly. Faster and more accurate than screenshot OCR.
Instructions
Run JavaScript in the active browser tab. Much faster than screenshot+OCR for web pages. Returns 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_javascript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript code to execute | |
| browser | No | 'safari' or 'chrome' (defaults to Safari) |