Skip to main content
Glama

Prove whether focus is visible on one control

qa_focus_proof

Focus a control and measure whether its focus ring appears by comparing outline, box-shadow, border, and color changes plus the percentage of differing pixels between unfocused and focused frames.

Instructions

THE ARGUMENT NOBODY WINS WITH A SCREENSHOT, ended with two numbers. Focus the control and measure what actually changed: which of the four properties that can draw a ring moved (outline, box-shadow, border, colours), and what fraction of the PIXELS differ between the two frames. «Nothing in the styles changed and 0.0% of the pixels moved» is a sentence a developer cannot argue with; a screenshot of a missing ring looks exactly like a screenshot of a faint one. It is careful about the three ways this test lies elsewhere: the crop is widened by however far the styles say the ring can reach (an outline is drawn OUTSIDE the box, and a tight crop would swear it was absent), the second frame is taken after any transition has had time to finish, and a ring that is present but faint is reported as present — that is a contrast question, and this verb refuses to collapse the two. Read-only, and it puts focus back where it found it. Returns both frames, so the picture and the number travel together.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "qa_focus_proof"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoWrite the two frames here as <name>-unfocused.png and <name>-focused.png instead of returning them inline
tabIdNoTarget tab (from qa_tabs); omit for the active tab
selectorYesThe control to test — a CSS selector. Take it from qa_snapshot or from a focus walk stop.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.86.2

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description does the heavy lifting well: it declares read-only, states it restores focus to where it found it, explains that the crop is widened to the ring's reachable extent, that the second frame waits for transitions, and that a faint-but-present ring is reported present rather than collapsed into a contrast verdict. Gaps remain around behavior with non-matching or multi-matching selectors and whether results are cached, which keeps it below a 5.

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

Conciseness2/5

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

Heavily padded with rhetorical framing — 'THE ARGUMENT NOBODY WINS WITH A SCREENSHOT', 'a sentence a developer cannot argue with' — and the actual action is deferred past the first clause. The substantive content (four properties, pixel fraction, three lying modes) is valuable, but it is buried in repetition and capitalization rather than structured for scanning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 the description does name the two returned numbers and the two frames, plus file-writing behavior via path, so an agent can anticipate the response. It covers safety, timing, and known false-negative modes. It would be fully complete with an explicit statement of what happens when the selector matches nothing or several elements.

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 explains selector, tabId, and path. The description adds only the framing that both frames are returned 'so the picture and the number travel together,' which relates to the path option but adds no syntax or default details beyond the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The operative sentence — 'Focus the control and measure what actually changed: which of the four properties that can draw a ring moved ... and what fraction of the PIXELS differ' — gives a specific verb, resource, and measurement. It is clearly a focus-visibility proof rather than a generic screenshot or style dump. The rhetorical opener and title carry weight before that sentence lands, so it is clear but not front-loaded.

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?

Usage is implied through contrast — a screenshot 'of a missing ring looks exactly like a screenshot of a faint one' — which tells the agent to prefer this over visual inspection. However, no sibling is named as an alternative (e.g. qa_frames, qa_focus_walk), and there are no explicit preconditions such as needing the control present or the tab targeted.

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