Skip to main content
Glama

Measure Cumulative Layout Shift (CLS)

measure_layout_shift

Measure cumulative layout shift on cold page load, pinpoint elements that jumped, and get a pass/fail verdict against Core Web Vitals thresholds.

Instructions

Cold-load CLS diagnostic: arms a layout-shift observer BEFORE the page parses, reloads, watches ~2s, then reports the aggregate score (good ≤ 0.10, poor > 0.25) and the exact elements that jumped, ranked by attributed shift — jank no static screenshot shows. Zero image tokens. Rebuilds a pristine page, discarding any in-page state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesAbsolute URL to open, e.g. http://localhost:5173.
maxClsNoCI gate: FAIL when CLS exceeds this (0.1 is the Core Web Vitals bar). Omit to report without a verdict.
viewportNoSwitch to this breakpoint first. Default: keep the current one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.29.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so thoroughly. It discloses the observer timing (before page parses), the reload behavior, the ~2s watch window, the output (aggregate score and ranked elements), the cost profile (zero image tokens), and the side effect of discarding in-page state. This is comprehensive and transparent.

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?

The description is a single dense paragraph with no wasted words. It front-loads the core purpose, then details mechanism, output, differentiator, and side effects in logical order. Every clause earns its place, balancing completeness with brevity.

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 moderate complexity, no output schema, and no annotations, the description is unusually complete. It explains the return format (aggregate score and element list), the thresholds for interpretation, the measurement method, and the side effects. An agent has enough to call it correctly and interpret results without further assumptions.

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 coverage is 100%, so the schema already documents all parameters. The description adds value by providing CLS thresholds (good ≤0.10, poor >0.25) that directly inform the maxCls parameter and by explaining the measurement window (~2s) relevant to interpreting results. This goes beyond the schema's basic 'CI gate' wording.

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 uses a specific verb ('arms', 'reloads', 'watches', 'reports') tied to a clear resource (layout shift) and scope (cold-load CLS diagnostic). It distinguishes itself from screenshot tools by noting 'jank no static screenshot shows', making its unique purpose evident.

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 implies usage for diagnosing layout shift on cold load and contrasts with static screenshots, but it does not explicitly name alternatives or state when not to use it. There is no clear routing to sibling tools like measure_element or matrix_responsive_audit. The guidance is implied rather than explicit.

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