Skip to main content
Glama

verify_code

Compare Flutter code to a Figma design by rendering both at 2x and reporting analyzer/runtime errors, pixel differences, and a visual diff. Use after implementing a frame to fix mismatches.

Instructions

Check Flutter code against the design: analyzes it, renders it with flutter test at 2x, and compares the render with Figma's own 2x render of the node. Returns analyzer errors, runtime errors (overflows, missing assets), the share of differing pixels and a diff image (the design in grey, differing pixels in red).

With file, it checks that widget inside its own Flutter project: the project's packages and assets, inside a MaterialApp, scaled by flutter_screenutil to the frame size when the project uses it. The widget needs a constructor without arguments. Without file, it checks the reference code get_design_context generates and also compares every layer's box. Use it after implementing a frame, and fix what it reports. Text in fonts it cannot find is drawn in a fallback font, and emoji have no colour font in the test, so text after them shifts. A run takes from 20 seconds to a few minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoThe .dart file with the widget, under the project's lib/ (absolute, or relative to the project).
fontsNoFolders with font files (default: the project's assets/fonts and the system fonts).
nodeIdNoThe ID of the node, eg. "123:456" or "123-456" (instance ids like "I1:2;3:4" work too). Omit it to use the current selection in Figma.
widgetNoThe widget class in `file` (default: its first widget class).
fileKeyNoThe key of the Figma file. Accepted for compatibility; the file open in Figma Desktop is always used.
flutterNoPath of the flutter tool, when it is not on PATH.
viewportNoLay the code out on a screen of this size, e.g. "360x780", and report runtime errors (overflows) and layers pushed off screen instead of comparing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.5.1

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: it discloses the return artifacts (analyzer errors, runtime errors such as overflows/missing assets, differing-pixel share, diff image), runtime cost (20 seconds to a few minutes), and fidelity caveats (fallback fonts for missing fonts, emoji lacking color fonts shifting subsequent text). These are exactly the traits an agent needs to interpret results.

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 core purpose and outputs are front-loaded in the first sentence, and subsequent sentences add mode-specific instructions, a usage trigger, caveats, and timing. It is dense but nearly every clause carries information; the only mild cost is that the mode differences are packed into a single paragraph.

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?

Despite having no output schema and no annotations, the description fully explains return values, both execution modes, preconditions for the `file` path, and the runtime envelope. For a verification tool with seven optional parameters, an agent has everything required to invoke and interpret it correctly.

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 genuinely adds meaning beyond the schema: it explains that `file` runs the widget inside its own Flutter project with its packages/assets, inside a MaterialApp, scaled by flutter_screenutil, and that the widget needs an argument-less constructor. It also clarifies that `viewport` switches from comparison to overflow/off-screen reporting.

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 ('Check Flutter code against the design') and goes further to explain the mechanism (flutter test at 2x, comparison with Figma's 2x render) and the exact outputs. An agent can distinguish this verification tool from siblings like get_design_context or get_screenshot without opening any schema.

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 a clear condition for use: 'Use it after implementing a frame, and fix what it reports', and it distinguishes the two operating modes (with `file` vs without). It stops short of naming sibling tools or explicit when-not-to-use exclusions, so it lands just below the top tier.

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