Page(s)
https://playwright.dev/mcp/tools/screenshots
https://playwright.dev/mcp/tools/screenshots#element-screenshot
Description
Summary
The documentation for browser_take_screenshot incorrectly lists ref as the parameter to capture a screenshot of a specific element. However, the actual JSON schema and implementation of @playwright/mcp expect the parameter name target.
Issue
When passing { ref: "e12" } as shown in the documentation, @playwright/mcp does not recognize ref, causing it to ignore the argument and default to capturing the full viewport instead of cropping to the specified element.
Proposed Changes
- In the
browser_take_screenshot parameters table, change ref to target:
| Parameter |
Type |
Required |
Description |
type |
string |
no |
png (default), jpeg, or webp |
target |
string |
no |
Exact target element reference (ref) from page snapshot or unique element selector |
fullPage |
boolean |
no |
Capture full scrollable page |
- Update the Element screenshot example:
You: Take a screenshot of just the login form.
→ browser_take_screenshot { target: "e12" }
→ Returns: PNG image cropped to the element
Page(s)
https://playwright.dev/mcp/tools/screenshots
https://playwright.dev/mcp/tools/screenshots#element-screenshot
Description
Summary
The documentation for
browser_take_screenshotincorrectly listsrefas the parameter to capture a screenshot of a specific element. However, the actual JSON schema and implementation of@playwright/mcpexpect the parameter nametarget.Issue
When passing
{ ref: "e12" }as shown in the documentation,@playwright/mcpdoes not recognizeref, causing it to ignore the argument and default to capturing the full viewport instead of cropping to the specified element.Proposed Changes
browser_take_screenshotparameters table, changereftotarget:typepng(default),jpeg, orwebptargetref) from page snapshot or unique element selectorfullPageYou: Take a screenshot of just the login form. → browser_take_screenshot { target: "e12" } → Returns: PNG image cropped to the element