browser_evaluate
Run a JavaScript function inside the current page to inspect or modify DOM state, optionally passing an element, and return a JSON-serializable value.
Instructions
Run a JavaScript function inside the page. Function source must be an arrow or function expression.
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 | If set, runs the function with this element as argument. | |
| element | No | ||
| function | Yes | JS function source: must be an arrow or function expression. Receives the page (or element) and returns a JSON-serializable value. |