browser_evaluate
Run policy-gated read-only JavaScript in a browser tab when standard extraction methods fail. Use as a fallback for required facts.
Instructions
Run policy-gated read-only JavaScript in a tab only when browser_extract or browser_observe cannot return the required fact. For visible page text, labels, controls, or a region owned by aria-controls, use browser_extract instead; for computed styles, colors, fonts, sizes, icons or backgrounds, browser_extract read=design (the page, or one component with target_ref) or read=inspect (one element's box and styles).
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": {
"tab_id": "<tab_id>",
"function": "<function>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arg | No | Optional argument passed to the function. | |
| tab_id | Yes | ||
| function | Yes | JS function/expression (aliases: expression, code, js, script). |