Skip to main content
Glama

Computed styles and box of an element

qa_styles

Reads an element's computed CSS styles, pixel box, and in-scope design tokens via snapshot ref or selector so you can compare a built page against its design without screenshots.

Instructions

The COMPUTED styles of one element — colour, type, spacing, border, shadow, layout — plus its box in CSS pixels, and the CSS custom properties (design tokens) in scope for it. This is how you check a built page against a design: it answers "this button renders #3B82F6 at 15px with 22px padding" without a screenshot and without measuring anything by eye. Target it by a qa_snapshot ref (preferred) or a CSS selector. Read-only and executes NOTHING: the property list is fixed in the extension, so you name an element, never a program. Pair it with a design source (a Figma file, a token JSON) to report the diff, and with qa_spotlight to show the human which element you mean.

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_styles"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoA ref from qa_snapshot (e.g. "e12") — preferred over selector
tabIdNoTarget tab (from qa_tabs); omit for the active tab
tokensNoInclude the CSS custom properties in scope (default true)
frameIdNoWhich frame to ask, from qa_frames. Omit for the page itself. A payment form, an SSO step or an embedded widget usually lives in a frame of its own, and a cross-origin one can only be read from inside it.
selectorNoCSS selector of the element

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.86.2

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the safety burden well: it declares the tool read-only, that it 'executes NOTHING', and that the property list is fixed in the extension so a caller cannot inject an expression. It does not cover failure behavior (invalid ref, detached element, cross-origin frame refusals) or whether output is cached, so it stops short of full disclosure.

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?

Front-loaded with the returned content, then the use case, then targeting and pairings — a sensible order. A few phrases ('without a screenshot and without measuring anything by eye') are motivational rather than informative, costing some density.

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?

Five optional parameters, no output schema, no annotations — and the description compensates by explaining what data comes back (computed properties, box, tokens) and how to address the element. The only unaddressed area is error conditions, which is minor for a read-only inspection tool.

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 coverage is 100% and the schema already states ref is 'preferred over selector', which the description largely repeats. Beyond noting that a qa_snapshot ref or CSS selector targets the element, it adds no new meaning about tabId, frameId, or the tokens flag, so the schema is doing the work here.

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 names a specific resource ('COMPUTED styles of one element') and enumerates the returned value set — colour, type, spacing, border, shadow, layout, CSS-pixel box, and in-scope custom properties. It also implicitly separates itself from screenshot- or measurement-based siblings by framing the result as exact values rather than a rendering.

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

Usage Guidelines5/5

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

It states the use case ('check a built page against a design'), the preferred targeting method (qa_snapshot ref over CSS selector), and the pairing pattern with a design source and with qa_spotlight for human confirmation. The agent knows both how to aim it and what to combine it with.

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