browser_evaluate
Executes JavaScript in the active page and returns the result, optionally passing a referenced element to the expression for DOM inspection or data extraction.
Instructions
Execute JavaScript on the page and return the result.
If ref is provided, the expression receives the element as its first argument
(use element => element.textContent style arrow functions).
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_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | ||
| expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |