From 67ea8229ef60df3905d55e5ac1d3f76c0d0f6ef3 Mon Sep 17 00:00:00 2001 From: scs0209 Date: Thu, 3 Sep 2026 17:53:11 +0900 Subject: [PATCH] fix(docs): use target for browser_take_screenshot element param The MCP tool schema expects `target`, not `ref`. Documenting `ref` caused element screenshots to fall back to the full viewport. Fixes https://github.com/microsoft/playwright/issues/42517 Co-authored-by: Cursor --- mcp/tools/screenshots.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcp/tools/screenshots.mdx b/mcp/tools/screenshots.mdx index 3648f572ca..8bc5e007a8 100644 --- a/mcp/tools/screenshots.mdx +++ b/mcp/tools/screenshots.mdx @@ -11,7 +11,7 @@ Capture the current page, a specific element, or the full scrollable page. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `type` | string | no | `png` (default) or `jpeg` | -| `ref` | string | no | Element ref to screenshot a specific element | +| `target` | string | no | Exact target element reference (`ref`) from page snapshot or unique element selector | | `fullPage` | boolean | no | Capture full scrollable page | ### Page screenshot @@ -26,7 +26,7 @@ You: Take a screenshot of the current page. ```txt You: Take a screenshot of just the login form. -→ browser_take_screenshot { ref: "e12" } +→ browser_take_screenshot { target: "e12" } → Returns: PNG image cropped to the element ```