browser_evaluate
Run custom JavaScript in a webpage to extract data that accessibility snapshots miss, returning JSON-serializable results.
Instructions
Run arbitrary JavaScript in the page and return the result.
Example: document.title or ({hrefs: [...document.querySelectorAll('a')].map(a => a.href)}).
Use for scraping data the accessibility snapshot cannot express.
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": {
"js": "<js>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | Yes | JavaScript expression or statement body to run in the page. Return JSON-serializable values. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |