console_evaluate_javascript
Execute JavaScript expressions in the browser console and return results, enabling debugging and inspection of page state through DevTools.
Instructions
Execute JavaScript in the browser console and return the result
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": {
"contextId": "<contextId>",
"expression": "<expression>"
},
"name": "console_evaluate_javascript"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contextId | Yes | Browser context ID from browser_launch | |
| expression | Yes | JavaScript expression to evaluate | |
| includeCommandLineAPI | No | Include console command line API (like $0, $1, etc.) |