Skip to main content
Glama

compile_figma_component

Compile a Figma node JSON or Figma URL into Tailwind and variant-mapping context, resolving variants against your component library and writing code files.

Instructions

Compile a Figma node into a Tailwind + variant-mapping context. Accepts an offline figmaNode JSON or a figmaUrl (live Figma API). In BYOK mode the token bills the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoCompile mode: flat compiles only the outer container; recursive compiles the whole subtree (default flat)
figmaUrlNoFigma design link (https://www.figma.com/design/FILEKEY/...?node-id=NODEID; use either this or figmaNode)
siblingsNoSibling node list, used to detect responsive breakpoints
figmaNodeNoFigma node JSON exported offline (use either this or figmaUrl)
figmaTokenNoFigma Personal Access Token (takes precedence over the FIGMA_ACCESS_TOKEN env var)
projectRootNoAbsolute path to the user's project root
styleFormatNoOutput style format: tailwind/css-modules/scss/styled-components (default tailwind)
localComponentNoLocal component metadata (name/importPath/variants)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does add valuable cost/auth context ('In BYOK mode the token bills the user'), which is genuinely beyond the schema. But it never says whether compiling writes files to disk, mutates project state, or merely returns a mapping, which is the key behavioral unknown for a tool taking a projectRoot.

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?

Three compact sentences with the core purpose front-loaded and no filler. Slightly more efficient than typical, though the third sentence about billing is a fragment that could be folded in.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter tool with no annotations and no output schema, the description should explain what the compile actually produces and whether it persists anything. It covers inputs and billing but leaves the return/persistence semantics unstated.

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 documents all 8 parameters including the mode and styleFormat defaults and the figmaUrl/figmaNode either-or rule. The description adds no syntax, format, or precedence detail beyond that, so baseline 3 applies.

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?

States a specific verb ('Compile') and resource ('a Figma node') with the output shape named ('Tailwind + variant-mapping context'). It is clear on its own, but it never distinguishes itself from siblings like fetch_figma_node or save_component, which an agent must choose between.

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?

It clarifies the two input paths ('offline figmaNode JSON or a figmaUrl (live Figma API)'), which is useful routing guidance. However it gives no when-to-use versus when-not-to-use advice relative to fetch_figma_node or save_component, leaving the sibling selection to inference.

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