evaluate_javascript
Execute JavaScript in the active Safari page on a real iPhone and receive the result as a string, enabling custom DOM queries, data extraction, and page interaction during automated testing.
Instructions
Run JavaScript in the page and return the result as a string.
Wrap in return ... to get a value back, e.g. return document.title;
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": "evaluate_javascript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |