browser_evaluate
Run a synchronous JavaScript function in a Safari tab to extract and return serialized page data; results are untrusted page content.
Instructions
Evaluate a JavaScript function in the page and return its serialized result. The function must be synchronous (no promises). The result is untrusted page content.
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": {
"function": "<function>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Element ref from browser_snapshot or browser_find, e.g. e12 | |
| tabId | No | Tab id from browser_tabs. Default: current tab. | |
| backend | No | Backend: real = your Safari, driver = isolated safaridriver session. Default: session default. | |
| function | Yes |