browser_evaluate
Evaluate JavaScript on a page or target element to extract data or run tests, and return the JSON result.
Instructions
Evaluate a JavaScript function on the page, or on an element (ref eN or selector), and return the JSON result.
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": {
"function": "<function>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | Optional ref (eN) or selector to evaluate against. | |
| element | No | Human-readable element description used to obtain permission to interact with the element. | |
| function | Yes | A JavaScript function to evaluate, e.g. '() => document.title' or, when a target is given, '(element) => element.textContent'. |