Skip to main content
Glama
Figma Canvas MCP

Figma Canvas MCP

by AmroJSawan

figma_generate_component_doc

Generate structured component documentation from Figma components by merging design details with optional source-code info, covering anatomy, variants, tokens, and design-code parity.

Instructions

Generate AI-complete component documentation from a Figma component. Produces structured markdown with anatomy, per-variant color tokens, typography, content guidelines (parsed from Figma description), icon mapping, spacing tokens, and design-code parity analysis. Merges Figma design data with optional code-side info (CVA definitions, sub-component APIs, source files). Output works with any docs platform. For richest output, read the component source code first and pass codeInfo.

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": {
      "nodeId": "<nodeId>"
    },
    "name": "figma_generate_component_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
enrichNoEnable enrichment for token data
nodeIdYesComponent node ID (e.g., '695:313')
fileUrlNoFigma file URL. Uses current URL if omitted.
codeInfoNoCode-side documentation info. Read the component source code first, then fill in relevant sections. Include variantDefinition for CVA/variant code, subComponents for composable sub-parts, sourceFiles for all related files, and baseComponent for attribution.
sectionsNoToggle which sections to include
outputPathNoSuggested output file path
systemNameNoDesign system name for headers
includeFrontmatterNoInclude YAML frontmatter metadata

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.17.3

TDQS

A4.1/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 full burden and does reasonably well: it discloses the output format (structured markdown), the merge behavior with code-side data, and that the result is portable across docs platforms. It stops short of explicitly stating whether anything is written to disk or whether the Figma file is untouched, so an agent must infer non-destructiveness from the 'suggested output file path' framing.

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 action and output are front-loaded in the first sentence, followed by enrichment and then the workflow tip. The middle enumeration of document sections is dense but each item conveys real capability; there is little filler, though the sentence is long enough that it reads as a list rather than prose.

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?

For a complex tool with eight parameters, a nested object, and no output schema, the description covers the produced artifact thoroughly so return-value explanation is unnecessary. The remaining gap is behavioral edge cases, such as what happens when codeInfo is omitted or whether outputPath triggers a file write, which the description leaves implicit.

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%, so the schema already documents all eight parameters, including the deeply nested codeInfo object; that establishes a baseline of 3. The description adds some meaning by explaining the purpose of codeInfo (CVA definitions, sub-component APIs, source files) and its effect on output richness, but it says nothing about the sections toggles or outputPath semantics.

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?

States a specific verb and resource ('Generate ... component documentation from a Figma component') and then enumerates exactly what the artifact contains (anatomy, per-variant tokens, typography, content guidelines, icon mapping, parity analysis). This clearly separates it from read-only siblings like figma_get_component or figma_get_component_details, which retrieve data rather than produce a documentation document.

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?

Gives a concrete workflow prerequisite: 'For richest output, read the component source code first and pass codeInfo,' which tells the agent the ordering and the optional input that maximizes quality. It does not, however, state when to prefer this over sibling retrieval tools or when not to use it, so no explicit alternative routing is provided.

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

Deploy Server

Other Tools