Problem
When using take_screenshot on large viewports (e.g., testing responsive design on wide monitors or using fullPage: true on long pages), the tool fails with:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.7.content.2.image.source.base64.data: At least one of the image dimensions exceed max allowed size: 8000 pixels"}}
This happens frequently when testing responsive layouts, making the tool unusable for this common use case.
Expected behavior
Screenshots should be automatically resized to fit within Claude API limits (max 8000px per dimension) before being sent, preserving aspect ratio.
Reproduction
- Open a page in a browser with a large viewport or long scrollable content
- Call
take_screenshot (especially with fullPage: true)
- Tool fails with the above error
Suggested fix
Resize images before base64 encoding when any dimension exceeds 8000px, preserving aspect ratio. This is a common pattern in similar tools.
Environment
- MCP: chrome-devtools-mcp (latest via npx)
- Client: Claude Code
- OS: macOS
Problem
When using
take_screenshoton large viewports (e.g., testing responsive design on wide monitors or usingfullPage: trueon long pages), the tool fails with:This happens frequently when testing responsive layouts, making the tool unusable for this common use case.
Expected behavior
Screenshots should be automatically resized to fit within Claude API limits (max 8000px per dimension) before being sent, preserving aspect ratio.
Reproduction
take_screenshot(especially withfullPage: true)Suggested fix
Resize images before base64 encoding when any dimension exceeds 8000px, preserving aspect ratio. This is a common pattern in similar tools.
Environment