Skip to main content
Glama

Check an implementation against a contract

check_implementation
Read-only

Measure an implementation URL against a saved visual contract to verify UI layout, styles, and states match the reference after changes, returning deviations, pass rate, and missing selectors.

Instructions

Measures an implementation URL against a previously saved visual contract: box position and size, computed styles, hover and focus states, and pseudo-elements. Call this after building or changing a UI to verify it matches the reference without a human looking at it. Needs contractPath from a prior extract_contract call. Returns a formatted deviation table (capped at 40 rows, with a note on how many were left out) plus the numeric totals, the pass rate, any missing selectors, and ok, which is true only when nothing deviated and nothing is missing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe implementation URL to measure against the contract.
waitNoExtra settle time in milliseconds after navigation. Defaults to 2000.
timeoutNoNavigation timeout in milliseconds. Defaults to 30000.
headlessNoRun the browser headless. Defaults to true.
selectorNoCSS selector to scope the check to. Defaults to the contract root.
viewportNoViewport name to check, for example desktop. Defaults to the first viewport in the contract.
maxStatesNoMaximum interactive elements to probe. Defaults to 120.
toleranceNoAllowed pixel tolerance for box and length values. Defaults to 1.
contractPathYesPath to a contract JSON file previously written by extract_contract.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds substantial behavioral detail beyond annotations: the exact return shape includes a deviation table capped at 40 rows with an overflow note, numeric totals, pass rate, missing selectors, and the precise meaning of ok. This is rich disclosure for a tool without an output schema.

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?

Four compact sentences with no filler. The purpose is front-loaded, followed by usage guidance, prerequisite, and return details. Every sentence contributes distinct information.

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 9-parameter tool with no output schema, the description compensates by explaining the return contents in detail, including the 40-row cap and ok semantics. Annotations cover safety and open-world behavior, and the prerequisite contractPath origin is stated. Nothing essential is missing.

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 nine parameters, including defaults and constraints. The description only reiterates that contractPath comes from a prior extract_contract call, which is already stated in the schema description for that parameter. Baseline 3 is appropriate when the schema carries parameter meaning.

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 an implementation URL against a saved visual contract. It enumerates the visual dimensions checked (box position/size, computed styles, hover/focus states, pseudo-elements) and distinguishes itself from the sibling extract_contract by naming the contract as a required prior artifact.

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?

Gives clear when-to-use guidance: call after building or changing a UI to verify against a reference. It also states the prerequisite that contractPath must come from a prior extract_contract call. It does not explicitly compare against the sibling diff_pixels or state when not to use this tool.

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