Evaluate JavaScript
evaluateRun JavaScript expressions in the current page to extract data or inspect page state; results return as JSON with promises awaited.
Instructions
Evaluate a JavaScript expression in the page and return its value as JSON. Promises are awaited. Use for data extraction or page state, not for navigation (prefer navigate).
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 |
|---|---|---|---|
| max_chars | No | Output cap (default 8000). | |
| expression | Yes | JavaScript expression, e.g. document.title |