Evaluate JavaScript
evaluateRuns custom JavaScript inside a Playwright browser page for diagnostics when dedicated tools are insufficient, optionally targeting a specific page by ID.
Instructions
Evaluate JavaScript in the page. Use for diagnostics when dedicated tools are insufficient.
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": {
"script": "<script>"
},
"name": "evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arg | No | ||
| pageId | No | Page id. Defaults to the active page. | |
| script | Yes |