page_evaluate
Evaluate JavaScript expressions in a browser tab to inspect or modify page state, retrieve data, and trigger actions via the Chrome DevTools Protocol.
Instructions
Evaluate JavaScript expression in a tab.
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": {
"targetId": "<targetId>",
"expression": "<expression>"
},
"name": "page_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targetId | Yes | Target ID of the tab | |
| expression | Yes | JavaScript expression to evaluate | |
| returnByValue | No | Return result by value (default: true) |