From c42b42153a7995d24a1f1c09f1b6e9304a865503 Mon Sep 17 00:00:00 2001 From: masnwilliams <43387599+masnwilliams@users.noreply.github.com> Date: Tue, 21 Jul 2026 17:31:45 +0000 Subject: [PATCH] Fix stale snapshot tip in execute_playwright_code The page._snapshotForAI() internal method is not available in the browser runtime, so the tool hint pointed users at a call that throws "page._snapshotForAI is not a function". Point it at the supported locator.ariaSnapshot() instead, which returns the page accessibility tree. Co-Authored-By: Claude Opus 4.8 --- src/lib/mcp/tools/playwright.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/mcp/tools/playwright.ts b/src/lib/mcp/tools/playwright.ts index fddbd44..781dda5 100644 --- a/src/lib/mcp/tools/playwright.ts +++ b/src/lib/mcp/tools/playwright.ts @@ -11,7 +11,7 @@ export function registerPlaywrightTool(server: McpServer) { code: z .string() .describe( - 'Playwright/TypeScript code with a `page` object in scope. Example: "await page.goto(\\"https://example.com\\"); return await page.title();" Tip: Use `await page._snapshotForAI()` for a comprehensive page state snapshot.', + 'Playwright/TypeScript code with a `page` object in scope. Example: "await page.goto(\\"https://example.com\\"); return await page.title();" Tip: Use `await page.locator("body").ariaSnapshot()` for a comprehensive accessibility-tree snapshot of the page.', ), session_id: z .string()