pbi_run_code
Executes an async JavaScript function with the Playwright page object to send trusted mouse and keyboard inputs, enabling automation of report interactions not possible with standard tools.
Instructions
TRUSTED escape hatch (browser_run_code_unsafe equivalent). Runs an async JS function with the live Playwright reportView page — page.mouse/page.keyboard give REAL trusted input (unlike pbi_eval, which is page.evaluate and cannot do trusted clicks/keys). Use for rediscovery + interactions the canned tools do not cover. The code string must be an async arrow/function taking (page); its return value is JSON-serialized. Rejects powerBIAccessToken. UNSAFE: arbitrary automation — mutating clicks change report state, so restore after. The powerBIAccessToken rejection is a best-effort textual guard (a regex on the code string), not a sandbox. NOTE inside page.evaluate sandboxes setTimeout is undefined — use page.waitForTimeout(ms).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | async (page) => { ... } — returns JSON-serializable |