evaluate
Run JavaScript code directly in the browser page to perform calculations, adjust styles, access shadow DOM, and execute in-page actions that other tools do not cover.
Instructions
Run JavaScript in the page. Good uses: computation, style mutations (.style.X = ..., classList), shadow-root traversal, in-page fetch(), app-specific side effects no dedicated tool covers. Scope is shared between calls; top-level const/let/class are wrapped in an IIFE. If/else blocks may return undefined — use a ternary or an explicit return.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expression | Yes | JavaScript code to execute in the page context | |
| await_promise | No | Whether to await Promise results |