Run JavaScript
eval_jsEvaluate JavaScript expressions in a page's main world and return awaited results as JSON to inspect application state or DOM.
Instructions
Evaluates an expression in the page's main world and answers with its value as JSON (promises are awaited). For reading app state or the DOM; prefer click and type for input, which pages see as real.
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": "eval_js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes |