Skip to main content
Glama

Capture Multi-Viewport Responsive Snapshots

ink_capture_viewport
Idempotent

Capture desktop, vertical, and mobile viewport snapshots to verify layout integrity, responsiveness, and centering while detecting overflow.

Instructions

PURPOSE: Capture 3 high-resolution viewport snapshots (16:9 Desktop Landscape 1920x1080, 9:16 Vertical Story 1080x1920, and Mobile View 390x844) via headless Chromium to verify layout integrity, responsiveness, and optical centering.

BEHAVIOR: Launches local headless Chromium with an isolated temporary user-data profile. Renders the provided HTML string or URL, waits for network idle, and writes 3 PNG image files to the target outputDirectory (defaults to '.ink_snapshots/'). Detects horizontal scrollbar leaks and viewport overflow. Requires local Chromium/Chrome installed.

USAGE GUIDELINES:

  • When to use: Call after making HTML/CSS modifications or finishing a component to visually confirm that elements align properly across desktop, mobile, and tall vertical screens.

  • When NOT to use: Do NOT use for fast code syntax or contrast checks without browser rendering (use ink_validate_design instead).

  • Alternatives: Use ink_validate_design for fast static design linting; use ink_inspect_website_style to reverse-engineer design tokens from live URLs.

RETURNS: ResultEnvelope containing structured 'snapshots' list (with label, viewport, exact dimensions, file path, and size) and layout overflow metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleNoHuman-readable label used for image naming and output organizationSite Snapshot
htmlOrUrlYesHTML markup string, local file path (e.g. 'file:///index.html'), or public HTTP/HTTPS URL to render and photograph
outputDirectoryNoTarget folder where 16:9, 9:16, and mobile PNG snapshots are written (defaults to '.ink_snapshots')

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesDomain-specific typed payload returned by the tool
statusYesExecution outcome status
summaryYesConcise, human-readable executive summary of the tool outcome
evidenceNoAudit trail, source references, and generated artifact locations
warningsYesOperational cautions, craft advice, or non-blocking warnings
nextActionsNoActionable sequential recommendations or subsequent tool suggestions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.2.0
    • changedInput schema / properties / htmlOrUrl / description
      Previous value: -"HTML code string, local file path, or public URL to capture"New value: +"HTML markup string, local file path (e.g. 'file:///index.html'), or public HTTP/HTTPS URL to render and photograph"
    • changedInput schema / properties / outputDirectory / description
      Previous value: -"Target folder where 16:9, 9:16, and mobile screenshots are saved"New value: +"Target folder where 16:9, 9:16, and mobile PNG snapshots are written (defaults to '.ink_snapshots')"
    • changedInput schema / properties / title / description
      Previous value: -"Title or label for the captured snapshot"New value: +"Human-readable label used for image naming and output organization"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "additionalProperties": true,
      +      "description": "Domain-specific typed payload returned by the tool",
      +      "properties": {
      +        "layoutMetrics": {
      +          "additionalProperties": {},
      +          "description": "Computed scrollWidth, scrollHeight, and overflow metrics",
      +          "type": "object"
      +        },
      +        "outputDirectory": {
      +          "type": "string"
      +        },
      +        "snapshots": {
      +          "description": "List of 3 captured viewport images",
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "aspect_ratio": {
      +                "type": "string"
      +              },
      +              "dimensions": {
      +                "description": "Exact pixel dimensions (e.g. '1920x1080', '1080x1920', '390x844')",
      +                "type": "string"
      +              },
      +              "filePath": {
      +                "description": "Absolute path to the saved PNG snapshot file",
      +                "type": "string"
      +              },
      +              "fileSize": {
      +                "description": "Size of the PNG file in bytes",
      +                "type": "number"
      +              },
      +              "label": {
      +                "description": "Viewport descriptor (e.g., '16:9 Desktop Landscape', '9:16 Vertical Story', 'Mobile View')",
      +                "type": "string"
      +              },
      +              "viewport": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "label",
      +              "viewport",
      +              "dimensions",
      +              "aspect_ratio",
      +              "filePath"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "title": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "title",
      +        "outputDirectory",
      +        "snapshots"
      +      ],
      +      "type": "object"
      +    },
      +    "evidence": {
      +      "additionalProperties": false,
      +      "description": "Audit trail, source references, and generated artifact locations",
      +      "properties": {
      +        "artifacts": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "label": {
      +                "type": "string"
      +              },
      +              "sha256": {
      +                "type": "string"
      +              },
      +              "uri": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "label"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "inputsDigest": {
      +          "type": "string"
      +        },
      +        "sources": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "label": {
      +                "type": "string"
      +              },
      +              "retrievedAt": {
      +                "type": "string"
      +              },
      +              "uri": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "label"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "nextActions": {
      +      "description": "Actionable sequential recommendations or subsequent tool suggestions",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "status": {
      +      "description": "Execution outcome status",
      +      "enum": [
      +        "success",
      +        "partial",
      +        "blocked",
      +        "failed"
      +      ],
      +      "type": "string"
      +    },
      +    "summary": {
      +      "description": "Concise, human-readable executive summary of the tool outcome",
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "description": "Operational cautions, craft advice, or non-blocking warnings",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "summary",
      +    "data",
      +    "warnings"
      +  ],
      +  "type": "object"
      +}
  2. First observedv1.1.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond annotations (readOnly=false, idempotent=true, destructive=false), the description discloses key behaviors: launches headless Chromium with isolated temp profile, writes 3 PNG files, detects scrollbar leaks, and requires local Chromium. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (PURPOSE, BEHAVIOR, USAGE GUIDELINES, RETURNS) and front-loaded purpose. Every sentence adds value, and the length is justified for a tool with multiple behaviors and prerequisites.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (3 viewports, output structure, prerequisites), the description is complete: it covers when to use, behavior, prerequisites, and return format. The output schema exists and is referenced, so no further detail needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 100% of parameters with descriptions, so baseline is 3. The description adds minimal parameter-specific detail beyond the schema (e.g., default output directory is already in schema), but it doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: capture 3 specific viewport snapshots via headless Chromium to verify layout integrity, responsiveness, and optical centering. It names the exact resolutions and differentiates from siblings by mentioning alternatives, making it unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit 'When to use' and 'When NOT to use' guidance, and names specific alternatives (ink_validate_design, ink_inspect_website_style) with the conditions for choosing them. This is exemplary usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.