browser_evaluate
Run custom JavaScript in the active page and get the result—use it to extract page data, test conditions, or trigger actions directly in the browser context.
Instructions
Execute a custom JavaScript expression in the active page context and return the 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": {
"script": "<script>"
},
"name": "browser_evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | JavaScript code to evaluate (e.g. "document.title" or "window.location.href") |