Browser Evaluate
browser_evaluateExecute custom JavaScript in a page context to retrieve information or interact with elements. Optionally provide a selector to pass the matched element into the script.
Instructions
Run JavaScript 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": {
"sessionId": "<sessionId>",
"script": "<script>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | ||
| selector | No | Matched element passed as first arg to script. | |
| sessionId | Yes |