eval
Execute custom JavaScript against the current page's parsed DOM and get the JSON-stringified result, enabling direct manipulation and inspection when CSS selectors are insufficient.
Instructions
Run arbitrary JavaScript in the embedded QuickJS runtime against the current page's parsed DOM. Returns the JSON-stringified result. Power tool — prefer query/text/blockmap when the CSS selector engine can express what you need. Canonical param is code; raw JSON-RPC also accepts script or expression aliases and errors if no code-like param is present.
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": {
"code": "<code>"
},
"name": "eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JS code; the value of the last expression is returned |