Skip to content

Fix execute_playwright_code tool docs#456

Merged
dprevoznik merged 1 commit into
mainfrom
hypeship/fix-playwright-exec-docs
Jul 21, 2026
Merged

Fix execute_playwright_code tool docs#456
dprevoznik merged 1 commit into
mainfrom
hypeship/fix-playwright-exec-docs

Conversation

@dprevoznik

@dprevoznik dprevoznik commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

The execute_playwright_code reference page had two issues, mirroring the tool-description fix in kernel-mcp-server#125:

  1. page._snapshotForAI() doesn't work. The Tip recommended it for "a comprehensive page state snapshot," but it's a Playwright internal that isn't exposed in the stealth-patched execution runtime — it throws TypeError: page._snapshotForAI is not a function. It's also a whole-page dump (heavy on tokens). Replaced with region-scoped guidance: prefer a targeted selector or a region-scoped ariaSnapshot() rather than dumping the whole page.
  2. Incomplete scope. The code param said "a page object in scope." Per browsers/playwright-execution, page, context, and browser are all in scope. Updated, and noted that the returned value is what's sent back.

Docs-only.

Preview

reference/mcp-server/tools/execute-playwright-code


Note

Low Risk
Documentation-only changes to an MCP tool reference page; no runtime or API behavior changes.

Overview
Updates the execute_playwright_code MCP reference so it matches the real execution runtime and Playwright guidance.

The Tip no longer suggests page._snapshotForAI() (not available in the stealth-patched VM and token-heavy). It now steers agents toward targeted reads — e.g. innerText() on a locator or ariaSnapshot() on a region — instead of whole-page dumps, while still recommending computer_action screenshots over page.screenshot().

The code parameter description now documents page, context, and browser in scope and that the return value is what the tool sends back.

Reviewed by Cursor Bugbot for commit add1760. Bugbot is set up for automated code reviews on this repo. Configure here.

page._snapshotForAI() isn't available in the stealth-patched execution
runtime (throws TypeError) and dumps the whole page. Replace the tip with
region-scoped guidance, and note that page, context, and browser are all in
scope plus the return contract.
@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Kernel 🟢 Ready View Preview Jul 21, 2026, 9:41 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@dprevoznik
dprevoznik marked this pull request as ready for review July 21, 2026 21:41
@dprevoznik
dprevoznik requested review from masnwilliams and removed request for masnwilliams July 21, 2026 21:41

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk assessment: Very Low

This changes two lines in one documentation page: it clarifies the Playwright objects and return value available to execute_playwright_code, and replaces a broad page-snapshot recommendation with targeted selectors or scoped accessibility snapshots. There are no production codepaths, prompts, dependencies, configuration, infrastructure, or security boundaries affected. The blast radius is limited to user-facing reference guidance, and no CODEOWNERS file requires an ownership review.

Open in Web View Automation 

Sent by Cursor Automation: Assign PR reviewers

@dprevoznik
dprevoznik merged commit 59f9885 into main Jul 21, 2026
4 checks passed
@dprevoznik
dprevoznik deleted the hypeship/fix-playwright-exec-docs branch July 21, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant