evaluate
Run JavaScript in the active browser tab and return a JSON-serializable result, enabling custom page data extraction or interaction when snapshot/query tools are insufficient.
Instructions
Run JavaScript in the page and return the JSON-serializable result. Powerful; prefer snapshot/query when possible.
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": "evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | No | ||
| script | Yes | JS expression or statements; use "return x" for a value |