session_eval
Execute JavaScript in a live browser session and return the result, preserving DOM mutations, globals, and storage across calls for stateful page interaction.
Instructions
Execute arbitrary JavaScript in a live browser session and return the result. Runs in the session's current page, so DOM mutations, globals and storage persist across calls — unlike the stateless eval tool, which loads its own throwaway page each call. Script-driven navigation moves the session's URL. JS exceptions are reported with name, line/column and stack.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | JavaScript code to execute | |
| session_id | Yes | Session ID | |
| timeout_ms | No | Await budget for the script's promise in ms (default 5000, clamped 100..120000). Pass a larger budget for slow page-side work such as uploads through the page's own fetch; on expiry the tool errors with EVAL_TIMEOUT (the script may still be running) instead of returning a null result. |