Implements automatic validation of screenshot dimensions to prevent
"image dimensions exceed max allowed size: 8000 pixels" API errors.
New features:
✅ **Automatic size validation** - Rejects images > 8000px by default
✅ **allowLargeImages flag** - Override validation when needed
✅ **Smart error messages** - Helpful solutions when validation fails
✅ **Image dimension parsing** - Supports PNG and JPEG format detection
✅ **Updated tool description** - Documents size limits and flag usage
Error message provides actionable solutions:
1. Use viewport screenshot (remove fullPage: true)
2. Allow large images (add allowLargeImages: true)
3. Reduce viewport size (browser_configure)
4. Screenshot specific elements (element + ref)
Usage examples:
```json
// Safe viewport screenshot
{"filename": "safe.png"}
// Full page with validation
{"fullPage": true, "filename": "page.png"}
// Override validation for large images
{"fullPage": true, "allowLargeImages": true, "filename": "large.png"}
```
This prevents the frustrating API error: "At least one of the image
dimensions exceed max allowed size: 8000 pixels" by catching oversized
images before they reach the API and providing clear solutions.
Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive artifact storage system with session-specific directories:
- Add --artifact-dir CLI option and PLAYWRIGHT_MCP_ARTIFACT_DIR env var
- Create ArtifactManager class for session-specific artifact organization
- Implement ArtifactManagerRegistry for multi-session support
- Add tool call logging with JSON persistence in tool-calls.json
- Update screenshot, video, and PDF tools to use centralized storage
- Add browser_configure_artifacts tool for per-session control
- Support dynamic enable/disable without server restart
- Maintain backward compatibility when artifact storage not configured
Directory structure: {artifactDir}/{sessionId}/[artifacts, videos/, tool-calls.json]
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>