Skip to main content
Glama

analyze_design

Analyze a Figma design for visual quality, accessibility, or spec compliance. Get AI-driven feedback to fix issues before development.

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.
Behavior5/5

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

No annotations are provided, so the description carries full responsibility. It comprehensively documents prerequisites (Figma bridge, ANTHROPIC_API_KEY), error conditions (missing key, invalid node, missing spec), and return shapes for all three modes with detailed fields. This level of disclosure fully equips the agent to anticipate outcomes.

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 relatively long but well-organized into logical sections (Prerequisites, Returns, Error behavior, Mode selection guide, Best-use context). Every sentence serves a purpose—there is no redundant or filler content. Front-loading the core action ('Capture...analyze') is effective. Slightly longer than ideal, but structure justifies it.

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 (multiple modes, dependencies, error paths), the description covers all critical aspects: prerequisites, mode-specific outputs, error behavior, and usage context. There is no output schema, so the description must detail return values, which it does thoroughly for each mode. No gaps remain.

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?

Although schema description coverage is 100%, the description adds meaningful context beyond the schema: e.g., 'Omit to capture the entire current page' for nodeId, and elaborates on mode behaviors in the selection guide. The schema itself is clear, but the description enriches with operational hints (e.g., 'Obtain IDs from get_selection or get_page_tree').

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 starts with a clear verb+resource combination: 'Capture a Figma node as a screenshot and analyze it with AI vision (Claude).' It further distinguishes three distinct analysis modes (general, accessibility, spec-compliance), making it unique among siblings like capture_screenshot (capture only) or plan_ui_fixes (fix planning).

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?

Includes a dedicated 'Mode selection guide' with explicit scenarios for each mode (e.g., 'Use to verify that what's in Figma matches what's in the spec before generating code'). It also mentions the tool's place in a 'self-heal loop' and lists prerequisites. However, it stops short of explicitly saying when NOT to use the tool or naming direct sibling alternatives beyond capture_screenshot.

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/memi'

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