Skip to main content
Glama

Touch target estimate from CSS

touch_target_css
Read-only

Static estimate of the rendered size of interactive elements (a, button, input, select, textarea, summary, role=button/link, onclick) for WCAG 2.5.8 Target Size (Minimum, 24px) and the 44px guidance. Pass html and css, or a public url (page plus up to 12 stylesheets). It matches CSS rules to elements, uses explicit width/height/min sizes, padding, border, line-height and font-size (with browser defaults for form controls), guesses text width, reads margins and gap including li > a wrappers, and decides whether a neighboring control exists. Output groups elements by kind with a status: fail-estimate, under-24-isolated, under-24-spaced, inline (exempt inside a sentence), unknown (icon-only with no stated size) or ok. Optional viewport (default 390) selects media queries. States plainly that it is an estimate and includes a Puppeteer snippet for the rendered measurement. It does not apply state, sibling or structural selectors, transforms, container queries or script-set sizes.

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": "touch_target_css"
  }
}

Input Schema

NameRequiredDescriptionDefault
cssNoCSS source.
urlNoA public page URL to fetch.
htmlNoHTML markup.
viewportNoViewport width in px for media queries. Default 390.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/openWorld/destructive=false annotations: discloses the up-to-12-stylesheet fetch limit, browser defaults for form controls, text-width guessing, margin/gap and li > a handling, neighbor detection, the full status enum (fail-estimate, under-24-isolated, under-24-spaced, inline, unknown, ok), and an explicit list of what it does not handle (state/sibling/structural selectors, transforms, container queries, script-set sizes). This is exactly the behavioral context annotations cannot carry.

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?

The purpose, input modes, and limits are front-loaded, and the closing sentence on non-support preempts confusion. The middle sentence on matching rules, size sources, and neighbor detection is dense and long, but nearly all of it is load-bearing detail about how the estimate is produced.

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?

With no output schema, the description carries the burden and does so: it explains output grouping by element kind and defines every status value an agent will see. Combined with the stated limitations, an agent has enough to call this correctly and interpret its results.

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 meaning beyond the schema: `url` covers a page plus up to 12 stylesheets, `viewport` defaults to 390 and drives media-query selection, and `html`+`css` is presented as the alternative input mode. That is genuine semantic enrichment of the parameters.

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?

Names a precise verb+resource ('Static estimate of the rendered size of interactive elements') and enumerates the element set (a, button, input, select, textarea, summary, role-based, onclick) plus the standards it targets (WCAG 2.5.8, 44px). The 'static estimate' framing implicitly separates it from the rendered-measurement path, which it points to via the Puppeteer snippet.

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 call conditions: pass `html` and `css`, or a public `url`; `viewport` selects media queries. It also states plainly that the result is an estimate (with a rendered alternative), which is real usage guidance. It stops short of explicitly naming the sibling `check_touch_targets` or stating when to prefer it.

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.

Resources