Execute Script
executeRun custom Playwright scripts to replace 5-20 sequential browser operations with one call. Automate complex web flows using JavaScript with full page and context access for loops, conditions, and error handling in isolated sessions.
Instructions
Run a Playwright script with access to { page, context }. One tool call replaces 5-20 sequential MCP round trips. Use for complex flows with conditional logic, loops, error handling. NOTE: Scripts run in the Node.js process — equivalent to arbitrary code execution. Disable with LEAP_ALLOW_EXECUTE=false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | ||
| script | Yes | JavaScript async function body with access to { page, context }. Example: 'await page.goto("..."); return await page.title();' | |
| timeout | No | Timeout in ms. Default: 60000, max: 300000. |