MCP server that screenshots SVG files via headless Playwright and returns a base64 PNG to Claude Code
Single tool with well-structured schema and comprehensive parameter descriptions. Tool name 'screenshot_svg' is action-verb-based and clear. Input schema is complete with 6 parameters, all typed and described. Description (194 chars) explains WHAT, WHEN, and HOW. However, output schema is not documented, callers cannot see the structure of returned base64 image data. Error handling is present but minimal (only two validation checks). No pagination, batching, or advanced composition patterns. Baseline: avg tool description 194 chars (matches), avg params 4 (this has 6, acceptable). Missing: output schema documentation, error recovery guidance, idempotency hints.
Renders an SVG file (or raw SVG markup) as a PNG screenshot and returns it as a base64 image. Use file_path for files on disk (primary usage), or svg_content for inline SVG markup. Use focus_id to zoom into a specific element by its id attribute, or view_box to crop to a manual pixel region.
Output schema not documented. Callers cannot see the structure of the returned base64 PNG image or the 'content' array format. LLMs need explicit output schema to plan downstream operations.
Error messages lack recovery guidance. When 'Element with id not found' or 'view_box must be x y width height', no suggestion for next steps. Should guide LLM to retry with different parameters or fallback strategies.
No input validation for numeric parameters. 'padding' accepts any number but should be constrained (e.g., 0 - 100 pixels). 'view_box' parsing is fragile, no min/max for x, y, width, height values.
No idempotency or retry semantics documented. Playwright browser launch could timeout or fail transiently. Tool should declare whether repeated calls with same input produce same output (idempotent) or have side effects.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 61 | 2026-07-28+ | v2 |
Parameter 'background' accepts free-form CSS color strings with no validation. Should constrain to valid CSS colors (hex, rgb, named) or provide enum of common options (white, transparent, black).