browser_evaluate
Execute JavaScript on the current page to extract data, inspect page state, or trigger actions, then return the result.
Instructions
Run a JavaScript expression on the current page and return the result. Useful for extracting data, checking page state, or triggering actions. Example: browser_evaluate("document.querySelectorAll('a').length")
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": {
"js_expression": "<js_expression>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js_expression | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |