browser_eval
Execute JavaScript in the main world of a live Chrome or Brave page to inspect or modify content; optionally target a specific tab or frame.
Instructions
Evaluate JavaScript in the page main world. Nonzero frameId targets that Chrome frame when available to CDP.
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_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | No | Optional browser tab id to act on instead of the focused tab. | |
| frameId | No | ||
| timeoutMs | No | ||
| expression | Yes | ||
| awaitPromise | No | ||
| returnByValue | No |