evaluate
Execute JavaScript in a running Electron target over CDP to inspect or manipulate page/renderer state, defaulting to the first page target.
Instructions
Evaluate JavaScript in an Electron target via CDP Runtime.evaluate. Defaults to the first page/renderer target.
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": "evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | Preferred target role when targetId is omitted (default page) | |
| targetId | No | ||
| processId | No | Target process ID. Omit if only one app is running. | |
| expression | Yes | JavaScript expression to evaluate | |
| returnByValue | No |