javascript
Execute JavaScript within a Safari page and return the JSON-serialised result. Use it to extract page data or automate interactions by writing a function body with await supported.
Instructions
Run JavaScript in the page. Write a function body and return the value you want (await is allowed). Result is JSON-serialised.
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": "javascript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab id "windowId:tabIndex" from tabs_list. Omit for the active tab of the front window. | |
| code | Yes | ||
| timeout_ms | No |