js
Execute a JavaScript expression in an iOS Safari page and return its JSON value—use it to read or assert page state without screenshots or typing.
Instructions
Run a JavaScript expression in the page and return its value as JSON. Milliseconds, no screenshot or typing.
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": "js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | index in inspector_pages; default the first page with a real address | |
| wait | No | seconds to wait for the page list, default 60 | |
| expression | Yes | ||
| await_promise | No |