browser_eval
Evaluates JavaScript in a page or iframe to run targeted browser logic and inspect returned results. Use it for custom interactions or checks; prefer read-only DOM/text tools for extraction.
Instructions
Evaluate JS in page/iframe. Prefer read-only browser_dom(fields) or browser_text(main_only=true) for extraction; avoid fetch().
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "browser_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab index string (e.g. '0'), targetId, or URL/title substring. | |
| code | No | JS expression. | |
| file | No | Local JS file path. | |
| frame | No | Iframe #fN, id, URL substring, or 'any'. | |
| allow_network | No | Silence fetch/XHR/WS warning. |