Fix execute_playwright_code tool docs#456
Merged
Merged
Conversation
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.
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
dprevoznik
marked this pull request as ready for review
July 21, 2026 21:41
dprevoznik
requested review from
masnwilliams
and removed request for
masnwilliams
July 21, 2026 21:41
There was a problem hiding this comment.
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.
Sent by Cursor Automation: Assign PR reviewers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
The
execute_playwright_codereference page had two issues, mirroring the tool-description fix in kernel-mcp-server#125: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 throwsTypeError: 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-scopedariaSnapshot()rather than dumping the whole page.codeparam said "apageobject in scope." Per browsers/playwright-execution,page,context, andbrowserare all in scope. Updated, and noted that the returned value is what's sent back.Docs-only.
Preview
reference/mcp-server/tools/execute-playwright-codeNote
Low Risk
Documentation-only changes to an MCP tool reference page; no runtime or API behavior changes.
Overview
Updates the
execute_playwright_codeMCP 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 orariaSnapshot()on a region — instead of whole-page dumps, while still recommendingcomputer_actionscreenshots overpage.screenshot().The
codeparameter description now documentspage,context, andbrowserin scope and that thereturnvalue 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.