js.evaluate
Run JavaScript expressions in a Chromium DevTools console, including $, $$, and $x helpers, and await promises by default to inspect or probe live page state.
Instructions
Run an expression exactly as typing it into the DevTools console would, command-line helpers ($, $$, $x) included. Awaits promises by default.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "js.evaluate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Read the code from this path on the daemon host instead. Use for long probes, where escaping into JSON is error-prone. | |
| frame_id | No | ||
| max_chars | No | ||
| target_id | No | Target handle (tgt_*). Omit for the active page. | |
| browser_id | No | Browser handle (br_*). Omit to use the only running browser, or auto-launch one. | |
| expression | No | The code to run. Omit when using file. | |
| timeout_ms | No | ||
| await_promise | No | ||
| return_by_value | No | ||
| command_line_api | No | ||
| bypass_module_cache | No | Cache-bust dynamic import() calls. Without this the page can return a module it loaded earlier, so a probe silently reports stale values. |