Split screenshot into its own read-only tool - #135
Closed
masnwilliams wants to merge 2 commits into
Closed
Conversation
Screenshot was a terminal action inside computer_action, which meant the one capability every multimodal model can use was gated behind a tool flagged destructive, and clients with approval prompts confirmed on a read-only capture. Extract it as a standalone screenshot tool and point tool descriptions at execute_playwright_code as the default way to drive a browser, leaving computer_action for surfaces no selector can reach. Region screenshots also reported the full viewport as the coordinate space while returning a cropped image, so the offset a caller needed to add was never stated. The new tool reports the crop offset instead.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
masnwilliams
marked this pull request as ready for review
August 2, 2026 20:29
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5fef193. Configure here.
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
screenshotwas a terminal action insidecomputer_action. That bundled the one browser capability every multimodal model can use with the one that only works on models with pixel grounding, and it put a read-only capture behind a tool markeddestructiveHint: true— so clients with per-tool approval prompt on taking a screenshot.This splits
screenshotout as a standalone tool and repositions the remaining tools:screenshot— new, read-only (readOnlyHint: true,idempotentHint: true), optional region crop. Registered as its own toolset so it can be enabled/disabled independently ofcomputer.execute_playwright_code— description now states it's the primary way to drive a browser, and points atariaSnapshot()for locating elements without an image.computer_action— no longer handles screenshots. Description reframes it as the fallback for surfaces a selector can't reach (canvas, embedded PDFs, native dialogs, drag), and notes that coordinate accuracy depends on the calling model's grounding.next_actionshints frommanage_browsersandmanage_browser_poolsnow suggestexecute_playwright_code+screenshotinstead ofcomputer_action.Bug fixed along the way
Region screenshots returned a cropped image but reported
Viewport: WxH. Use these dimensions as the coordinate space. The image origin is the crop origin, not the screen origin, so a caller converting image coordinates to screen coordinates for a subsequent click had no way to know it needed to addregion.x/y. The new tool reports the crop offset and the conversion explicitly.Also drops a redundant
browsers.retrievecall — viewport dimensions are only needed for the uncropped case.Breaking change
computer_actionno longer acceptsscreenshotas an action type. Callers batchingclick, ..., screenshotin one request now need two calls. That trade is deliberate: the batching win applies to the flow we're steering away from, and keeping a duplicate screenshot path in both tools would leave the destructive-hint problem half-fixed. Clients re-read the tool list on connect, so this lands on reconnect.Not included
No screenshot downscaling. Pixel-grounding accuracy degrades above roughly 1024px wide, and the usual fix is to downscale server-side and rescale returned coordinates back up. That changes coordinate semantics for
computer_actionand is worth doing separately if we keep investing in the coordinate path.Testing
tsc --noEmitclean,prettier --checkclean on changed files,next buildcompiles (full build needs Clerk/CLI env vars this checkout doesn't have). Verified tool registration by instantiating the server and listing tools:screenshotregisters,computer_actionno longer advertises a screenshot action, andKERNEL_MCP_DISABLED_TOOLSETS=screenshot,computerremoves both. The repo has no test suite, so there are no automated tests to add or run.Note
Medium Risk
Breaking MCP contract:
computer_actionno longer supportsscreenshot, so existing clients must migrate; behavior change is limited to tool surface and agent guidance, not auth or data paths.Overview
Screenshot moves out of
computer_actioninto a dedicatedscreenshotMCP tool (readOnlyHint: true, optional region crop, its ownscreenshottoolset).computer_actionno longer accepts ascreenshotaction type—callers that batched clicks plus screenshot need separate tool calls.Tool guidance is updated so
execute_playwright_codeis described as the primary browser driver (includingariaSnapshot()for element discovery),computer_actionis framed as a coordinate fallback for non-selector surfaces, andmanage_browsers/manage_browser_poolsnext_actionspoint to Playwright +screenshotinstead ofcomputer_action. README and the debug prompt reference the new tool.Region screenshots now explain crop offset vs screen coordinates (fixing misleading full-viewport wording on cropped images); full-screen captures still report viewport size. Screenshot handling is removed from
computer-action.tsand implemented insrc/lib/mcp/tools/screenshot.ts, registered inregister.ts.Reviewed by Cursor Bugbot for commit 3d56458. Bugbot is set up for automated code reviews on this repo. Configure here.