Skip to main content
Glama

analyze_design

Analyzes Figma designs using AI vision to identify visual quality issues, check accessibility compliance, or verify spec adherence for design system validation.

Instructions

Capture a Figma node as a screenshot and analyze it with AI vision (Claude).

Prerequisites: Requires Figma bridge running and plugin connected. Also requires ANTHROPIC_API_KEY to be set in the environment — returns isError if the key is missing. For spec-compliance mode, the spec must exist in the registry.

Returns on success: Analysis object — shape varies by mode:

  • general: { summary: string, issues: [], suggestions: [], qualityScore: number }

  • accessibility: { summary: string, contrastIssues: [], touchTargetIssues: [], focusIssues: [], wcagLevel: "A"|"AA"|"AAA"|"fail" }

  • spec-compliance: { summary: string, compliant: boolean, mismatches: [], missingProps: [], extraElements: [] }

Error behavior: Returns isError if ANTHROPIC_API_KEY is not set, if Figma is not connected, if the node ID is invalid, or if specName is missing/not found when using spec-compliance mode.

Mode selection guide:

  • "general" — visual polish review: spacing consistency, color harmony, typography hierarchy, alignment. Use after creating or modifying a design to catch obvious quality issues.

  • "accessibility" — contrast ratio checks, touch target sizes, focus indicator visibility, text readability. Use when validating WCAG compliance of a specific frame or component.

  • "spec-compliance" — compares the rendered design against a saved spec's props, variants, and layout rules. Use to verify that what's in Figma matches what's in the spec before generating code.

This tool is best used as part of the self-heal loop: create → capture_screenshot → analyze_design → fix → verify.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdNoFigma node ID to capture and analyze (e.g. '123:456'). Omit to capture the entire current page. Obtain IDs from get_selection or get_page_tree.
modeNoAnalysis mode: 'general' for visual quality and polish, 'accessibility' for WCAG contrast/touch/focus checks, 'spec-compliance' to verify the design matches a saved spec (requires specName).general
specNameNoName of the spec to compare against (required when mode='spec-compliance'). Use get_specs to list available spec names.
Behavior4/5

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

With no annotations provided, the description carries full burden and does so well: it discloses prerequisites (Figma bridge, API key), error conditions (missing key, invalid node, missing spec), and return value shapes for each mode. It also mentions the tool's role in a broader workflow ('self-heal loop'). The only minor gap is lack of rate limit or performance details.

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 description is well-structured with clear sections (prerequisites, returns, error behavior, mode guide, workflow context). Most sentences earn their place, though the mode selection guide is slightly verbose. It's front-loaded with core functionality and efficiently covers essential details without redundancy.

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?

Given the tool's complexity (3 parameters, multiple modes, external dependencies) and lack of annotations/output schema, the description is remarkably complete: it covers prerequisites, error conditions, return shapes for all modes, usage guidance, and integration into a larger workflow. No significant gaps remain for agent understanding.

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 description coverage is 100%, so the baseline is 3. The description adds value by explaining the purpose of each mode in detail ('general' for visual polish, 'accessibility' for WCAG checks, 'spec-compliance' for spec matching) and linking parameters to prerequisites (specName required for spec-compliance mode). It doesn't add syntax details beyond the schema, but provides meaningful context.

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 clearly states the tool's purpose with specific verbs ('capture', 'analyze') and resources ('Figma node', 'AI vision'), distinguishing it from siblings like 'capture_screenshot' (which only captures) and 'run_audit' (which may be more general). It explicitly mentions using Claude for AI vision analysis.

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?

The description provides explicit guidance on when to use each mode ('general' for visual polish, 'accessibility' for WCAG compliance, 'spec-compliance' for spec matching), includes prerequisites (Figma bridge, API key), and positions it within a workflow ('self-heal loop'). It also distinguishes from alternatives by specifying mode-specific use cases.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sarveshsea/m-moire'

If you have feedback or need assistance with the MCP directory API, please join our Discord server