Skip to main content
Glama

Inspect Rendered Spacing

inspect-spacing
Read-onlyIdempotent

Measures spacing in a rendered interface from DOM geometry and returns the spacing faults with a correction for each. The first call returns a read-only capture script to run in the page. The second call takes the captured states, such as viewport widths or hover and focus states, and returns the measurements and findings. At desktop widths it also checks the layout against one density: compact, comfortable or spacious. It measures geometry only, so a clean result is not visual approval.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
detailNoDefaults to a short summary alongside the inline report. Use full for the capture script or all findings and measurements in text-only clients.summary
statesNoRendered layout states from the capture script. Omit on the first call to receive the script.
densityNoThe layout density to check against: compact, comfortable or spacious. Omit it to use the project's design config, then the design system's default, both read from the page's --layout-density variable, then the mode closest to the measured page.
toleranceNoPixel tolerance for grouping measurements. Defaults to 1px.
spacingScaleNoProject spacing tokens in CSS pixels. Defaults to 4, 8, 12, 16, 24, 32, 48, 64, 96, 128.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
scoreNo
rubricNo
statesNo
statusYes
densityNo
summaryNo
findingsNo
nextStepNo
rubricStatusNo
captureScriptNo
missingWidthsNo
capturedWidthsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / density
      Added value: +{
      +  "description": "The layout density to check against: compact, comfortable or spacious. Omit it to use the project's design config, then the design system's default, both read from the page's --layout-density variable, then the mode closest to the measured page.",
      +  "enum": [
      +    "compact",
      +    "comfortable",
      +    "spacious"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / states / items / properties / density
      Added value: +{
      +  "description": "The density the page declares through the kit's --layout-density variable. The capture script fills it.",
      +  "properties": {
      +    "mode": {
      +      "maxLength": 20,
      +      "type": "string"
      +    },
      +    "source": {
      +      "maxLength": 20,
      +      "type": "string"
      +    },
      +    "unit": {
      +      "exclusiveMinimum": 0,
      +      "maximum": 64,
      +      "type": "number"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedOutput schema / properties / density
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "mode": {
      +      "enum": [
      +        "compact",
      +        "comfortable",
      +        "spacious"
      +      ],
      +      "type": "string"
      +    },
      +    "roles": {
      +      "items": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "expected": {
      +            "type": "number"
      +          },
      +          "matches": {
      +            "type": "boolean"
      +          },
      +          "measured": {
      +            "type": "number"
      +          },
      +          "role": {
      +            "enum": [
      +              "sidebarWidth",
      +              "pageInset",
      +              "sectionGap",
      +              "columnGap",
      +              "cardPadding"
      +            ],
      +            "type": "string"
      +          },
      +          "state": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "role",
      +          "state",
      +          "measured",
      +          "expected",
      +          "matches"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "source": {
      +      "enum": [
      +        "argument",
      +        "project",
      +        "design-system",
      +        "measured"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "mode",
      +    "source",
      +    "roles"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • addedOutput schema / properties / nextStep
      Added value: +{
      +  "type": "string"
      +}
  3. Changed3 schema fields changed
    • addedInput schema / properties / states / items / properties / elements / description
      Added value: +"Every element, in page order."
    • addedInput schema / properties / states / items / properties / elements / items / properties / label / description
      Added value: +"The text a person sees on it: a button's or heading's text, or an image's alt text. Reports name the element by it."
    • addedInput schema / properties / states / items / properties / title / description
      Added value: +"The page title, document.title. The Review tab names the check by it."
  4. Changed2 schema fields changed
    • addedInput schema / properties / states / items / properties / title
      Added value: +{
      +  "maxLength": 160,
      +  "type": "string"
      +}
    • addedOutput schema / properties / states / items / properties / elements / items / properties / name
      Added value: +{
      +  "type": "string"
      +}
  5. Changed2 schema fields changed
    • addedInput schema / properties / states / items / properties / elements / items / properties / inertCrop
      Added value: +{
      +  "properties": {
      +    "height": {
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "width": {
      +      "minimum": 0,
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "width",
      +    "height"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / states / items / properties / elements / items / properties / style / properties / textOverflow
      Added value: +{
      +  "maxLength": 60,
      +  "type": "string"
      +}
  6. Changed1 schema field changed
    • addedInput schema / properties / states / items / properties / elements / items / properties / inputType
      Added value: +{
      +  "maxLength": 40,
      +  "type": "string"
      +}
  7. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description still adds real behavioral context: the first call returns a script rather than findings, density checks only apply at desktop widths, and — most valuably — 'it measures geometry only, so a clean result is not visual approval', which caps the agent's interpretation of a pass.

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

Conciseness4/5

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

Four sentences, front-loaded with purpose followed by the workflow and the caveat. Every sentence carries information and nothing is redundant, though the second and third sentences are dense enough that a sub-clause could be trimmed.

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?

For a two-phase, 5-parameter tool with an output schema and rich annotations, all the agent needs is present: what it does, the call sequence, what inputs the second call expects, and the limits of the result. Return values are covered by the output schema, so the description is complete.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description goes slightly beyond the schema by explaining what the states parameter actually contains (viewport widths, hover and focus states) and that density is checked against compact/comfortable/spacious, giving conceptual grounding the schema alone doesn't.

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?

States a specific verb and resource — measures spacing in a rendered interface from DOM geometry — and states the deliverable: spacing faults with a correction for each. No sibling tool covers rendered spacing, and the two-call protocol is spelled out, so an agent can immediately tell what this does.

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

Usage Guidelines4/5

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

Explicitly describes the workflow condition: call once without states to get the capture script, call again with captured states to get findings. That is clear usage context. It stops short of naming an alternative tool or an explicit when-not-to-use, so it is not a full 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.