get_figma_component
Fetch a Figma node by URL to receive pruned, tokenized IR with resolved CSS variables, a Tailwind theme, and a component registry. Call with summary:true first to decompose large frames.
Instructions
Get a Figma node by URL. Returns a deterministic, pruned + tokenized + componentized IR with a :root{} CSS-variable block, a Tailwind theme, and a component registry. Colors/spacing/fonts are already resolved to $--var references — the caller does NOT need to re-match raw RGBA against :root. For large sections, call with summary:true FIRST to get a compact { cssVars, tailwindTheme, registry, sections[] } object (top-level children with bounding boxes) WITHOUT the full node tree; this replaces manual get_figma_file decomposition. Then fetch individual sections (optionally with maxDepth) to build them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lean | No | Omit the global blocks (CSS vars, Tailwind theme, component registry) that are identical on every call. Pass true on per-section fetches AFTER the summary call to avoid re-sending ~15KB of duplicated tokens/registry each time. The annotated IR still carries $--var references. Default false. | |
| prune | No | Run the deterministic noise-pruning pass (collapse decorative wrappers, drop invisible/zero-size nodes). Default true; set false for raw IR (debug). | |
| format | No | (non-summary) IR shape. "nested" (default) = full annotated tree. "flat" = a flat array of compact node records (render fields only, coords RELATIVE to the root frame) — much smaller and machine-readable. Use format:"flat" + lean:true for per-section fetches so you NEVER hand-read a deep multi-thousand-line tree. | nested |
| minFreq | No | Minimum occurrences for a value to become a design token during tokenization (default 2). | |
| summary | No | When true, return a compact summary (component meta, CSS vars, Tailwind theme, component registry, and top-level sections with bounding boxes) instead of the full annotated IR tree. Recommended first call for large frames/sections — avoids reading a multi-thousand-line IR. | |
| figmaUrl | Yes | Full Figma URL to a specific node (e.g., https://www.figma.com/design/{fileId}/...?node-id={nodeId}) | |
| maxDepth | No | Cap the IR tree depth (e.g. 3-4) to keep a large section compact without manual decomposition. Omit for full depth. | |
| tokenize | No | Run frequency-analysis tokenization: emit :root CSS vars + Tailwind theme and replace raw color/spacing/font values in the IR with $--var references. Default true. | |
| componentize | No | Cluster repeated nodes into a component registry with variant axes and named text styles. Default true. |