Skip to main content
Glama

What width the code DECLARES, not what it measured

qa_width_law

Reads the width ceilings declared in your layout code, names the element setting the tightest one, and optionally compares them against a mockup width to show where the content band diverges.

Instructions

THE LAW, NOT THE READING. «The container is 1360 wide» is a fact about the window it was measured in, true here and false one drag of the mouse later — which is why comparing a layout to a mockup by measuring has never worked. This reads what the CODE DECLARED instead: how many width ceilings exist on the layout spine, which element sets the tightest one, and what content band follows from that at any window. A declaration does not move when the window does, so it can be compared with a mockup and argued about. Pass figmaWidth (one number off the design, e.g. 1400) and it prints the two declarations side by side plus what follows — «the mockup declares one ceiling at 1400; the code declares none at all; at 1920 the band is 1840, which is 440 wider». It NEVER says which of the two is right: that is the human's call, and an instrument that guesses it is one nobody trusts twice. VALUES THAT MOVE WITH THE WINDOW ARE REFUSED ON PURPOSE. clamp(), vw and percentages declare no single law, so they go to a notMeasured list with the reason instead of being resolved at the current window and printed as if they were fixed — that number would be right on this screen and wrong on the next, and indistinguishable from a real finding. Narrow boxes (a sidebar, a card) are not judged either: they are narrow by design. Read-only and free. Read notMeasured FIRST — a clean page and an unexamined one look identical without it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "qa_width_law"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdNoTarget tab (from qa_tabs); omit for the active tab
withinNoScope to this container (a CSS selector). Omit for the whole page, which is usually what you want — the spine starts at <body>.
figmaWidthNoThe mockup's own declared content width, one number. With it you get the comparison; without it you still get what the code declares.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.86.2

TDQS

A4.5/5.0
Behavior5/5

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

With zero annotations, the description carries the full burden and does so: it declares itself read-only and free, states it deliberately refuses clamp()/vw/percentage values into a `notMeasured` list, and explains why resolving them would be indistinguishable from a real finding. It also discloses a key limitation — narrow boxes are not judged — and states it never renders a verdict on code-vs-mockup.

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

Conciseness3/5

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

The key constraint is front-loaded and the overall arc is logical, but the prose is long and rhetorical, with editorial asides ('an instrument that guesses it is one nobody trusts twice') and shouted caps that add tone rather than information. A tighter version would keep the refusal semantics and drop the flourish.

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?

There is no output schema and no annotations, so the description must explain both behavior and return shape — and it does, describing the printed side-by-side declarations, the `notMeasured` list, and the ordering advice. For a three-parameter read-only analysis tool this is sufficient for correct invocation.

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 baseline is 3, but the description adds real meaning: figmaWidth is 'one number off the design, e.g. 1400' and its presence unlocks the side-by-side comparison output, while absence still yields the code's declarations. It also clarifies that `within` defaults to the whole page with the spine starting at <body>, going beyond the schema's 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 states a specific verb and resource — it reads the width ceilings the code declares on the layout spine, names which element sets the tightest one, and derives the resulting content band. It also draws a hard line against the sibling activity of measuring the rendered window, so an agent can tell exactly what class of answer this tool returns.

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?

It gives clear operating context: pass figmaWidth when you want a mockup comparison, omit it to get only the code's declarations, and read `notMeasured` first. What's missing is an explicit named alternative for the measurement approach it argues against — the exclusion is made conceptually ('comparing by measuring has never worked') rather than by routing to a specific tool.

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