evaluate_js
Evaluate JavaScript in a browser frame or targeted element by ref, selector, or text, and return JSON; optionally save full results to a file.
Instructions
Evaluate JavaScript in a frame or element (ref/selector/text passes el and arg); returns JSON.
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": {
"expression": "<expression>"
},
"name": "evaluate_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arg | No | ||
| ref | No | Optional target element ref (passes (el, arg) to expression). | |
| text | No | Optional visible text target (passes (el, arg) to expression). | |
| tabId | No | ||
| frameIdx | No | ||
| savePath | No | File under cwd or TURBO_BROWSER_SAVE_ROOT. Full result goes to the file; the reply has only savePath, bytes and a 300-char preview. | |
| selector | No | Optional target selector (passes (el, arg) to expression). | |
| expression | Yes |