evaluate
Run a JavaScript expression in the current page and return its JSON value, including awaited promises, to extract data that other tools cannot read.
Instructions
Run a JavaScript expression in the current page and return its value as JSON (a promise is awaited). For data the other tools do not read.
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": "evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | JavaScript expression, e.g. `document.title` or `[...document.querySelectorAll('h2')].map(e => e.textContent)`. |