Skip to content

fix(docs): use target for browser_take_screenshot element param - #2131

Open
Changsu Seong (scs0209) wants to merge 1 commit into
microsoft:mainfrom
scs0209:fix/mcp-screenshot-target-param
Open

fix(docs): use target for browser_take_screenshot element param#2131
Changsu Seong (scs0209) wants to merge 1 commit into
microsoft:mainfrom
scs0209:fix/mcp-screenshot-target-param

Conversation

@scs0209

Copy link
Copy Markdown

Summary

  • Update browser_take_screenshot docs to use target instead of ref
  • Matches the @playwright/mcp tool schema so element screenshots are cropped correctly

Fixes microsoft/playwright#42517

Test plan

  • Confirm parameter table on /mcp/tools/screenshots shows target
  • Confirm Element screenshot example uses { target: "e12" }

Made with Cursor

The MCP tool schema expects `target`, not `ref`. Documenting `ref`
caused element screenshots to fall back to the full viewport.

Fixes microsoft/playwright#42517

Co-authored-by: Cursor <cursoragent@cursor.com>
@EDWARD-012

Copy link
Copy Markdown

Heads-up: opened a broader docs PR that also fixes screenshots.mdx plus interaction/forms/etc.: https://github.com/microsoft/playwright.dev/pulls?q=is%3Apr+author%3AEDWARD-012

Tracking: microsoft/playwright#42539 (related to microsoft/playwright#42517). Happy for maintainers to take either your screenshots-only change or the combined PR — no hard feelings either way.

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.

[Docs]: Fix parameter name for element screenshots in browser_take_screenshot MCP Tool

2 participants