Skip to main content
Glama

Layout diagnostics across all breakpoints (text-only)

detect_layout_matrix

Audit a page's responsive layout across all breakpoints in one call, flagging overflow, clipped text, collisions, and undersized tap targets. Returns unique selectors and annotated screenshots for each affected viewport.

Instructions

Zero-image layout diagnostics across all four breakpoints in one call. An in-page script measures the DOM and flags horizontal overflow, container spill or clipping, silently truncated text, destructive collisions, and sub-44px tap targets on mobile. Findings carry unique, addressable selectors. With annotate (default on), each breakpoint with findings also gets a red-outline render saved to disk and reported by path, costing no image tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesAbsolute URL to open, e.g. http://localhost:5173.
reloadNoReload even if the URL is already open (default reuses it, so it can be stale after an edit).
annotateNoDefault true: viewports with issues also get an annotated screenshot saved to disk. Never returned, so it costs no image tokens.
maxIssuesNoCI gate: mark the response a FAILURE when issues exceed this (0 = must be clean). Omit to report without a verdict.
ignoreSelectorNoSelector(s) to exclude from the audit, string or array. Matches and their descendants are suppressed and counted — silences known noise like a cookie banner.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.29.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden, and it does well: it reveals that an in-page DOM script runs, that findings have unique selectors, and that annotate (on by default) writes red-outline renders to disk and reports their paths. It also clarifies the image-token cost implication. It does not mention failure modes or verdict behavior, but the schema covers maxIssues.

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?

Three tightly written sentences lead with the core value proposition and then add detection scope, output properties, and the annotate side effect. There is no filler or redundant restating of schema fields.

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

Completeness4/5

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

The description is complete enough to invoke the tool correctly: it explains what is measured, what issues are flagged, what output shape to expect (selectors and optional saved renders), and the image-token cost. It does not spell out the exact response format, but that is partially covered by the rich parameter schema and the absence of an output schema is compensated by the explicit 'findings' language.

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 description coverage is 100%, so the schema already documents all five parameters. The description adds some contextual value around annotate by explaining the red-outline disk output, but it does not meaningfully enrich url, reload, maxIssues, or ignoreSelector beyond what the schema already provides.

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 opens with a specific verb-resource pair ('layout diagnostics across all four breakpoints') and enumerates concrete defect types: horizontal overflow, spill/clipping, truncated text, collisions, and sub-44px tap targets. It distinguishes itself from screenshot-based siblings by emphasizing 'zero-image' and 'text-only' while promising unique addressable selectors.

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

Usage Guidelines3/5

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

The description clearly implies a use case: run a text-only, multi-breakpoint layout audit in one call. However, it never explicitly states when to prefer this over sibling tools such as matrix_responsive_audit, capture_page_screenshot, or find_breakpoints, nor does it mention when not to use it.

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