browser_evaluate
Execute JavaScript in a Playwright page context by page ID to inspect or manipulate the DOM and retrieve runtime values for UI verification and automation.
Instructions
Execute JavaScript code in the page context
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": {
"pageId": "<pageId>",
"script": "<script>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The page ID | |
| script | Yes | JavaScript code to execute |