Run JavaScript in the page
browser_evaluateWeb development and debugging only, never ordinary browsing: run JavaScript in the page like the DevTools console; answers its value or exception. Pages can notice what it changes.
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": {
"expression": "<expression>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| world | No | Default main, the page's own. | |
| tab_id | No | A result's tab_id. | |
| frame_id | No | ||
| max_chars | No | Default 20000. | |
| expression | Yes | ||
| session_id | No | Only with several sessions. | |
| await_promise | No | Default true. |