Lupa
v0.3.4Read-only Figma for coding agents: exact layout, tokens mapped to your CSS, assets and a pixel diff.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
status Connection status
Which Figma files are connected through the Lupa plugin, their current page and selection.
get_outline Page outline
Lists pages and their top-level frames (ids, sizes) — a cheap map of the file for finding what to implement.
| Parameter | Type | Description |
|---|---|---|
depth | integer | Levels below the page (default 1). |
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
page | string | Page name or id; "*" lists every page's frames. Default: current page. |
find_nodes Find layers
Search layers by name (or text content with text:true) across the file, a page, or inside a node.
| Parameter | Type | Description |
|---|---|---|
query * | string | Case-insensitive substring. |
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
limit | integer | |
page | string | Page name or id; "*" or omitted = all pages. |
text | boolean | Match text content of text layers instead of layer names. |
types | array | Layer types, e.g. ["FRAME","COMPONENT","INSTANCE","TEXT"]. |
within | string | Only search inside this node id. |
get_design Read a design
The main tool: a compact, exact description of a frame/component (layout, sizes, colours, typography, tokens, components, overrides) for reproducing it in code. Output is breadth-first within a token budget; cut subtrees say how to fetch them.
| Parameter | Type | Description |
|---|---|---|
assets_dir | string | Also write the icons (SVG) and images to this folder; each layer then names its file in src: (saves a separate export_assets call). |
budget | integer | Approximate output size in tokens (default 8000). |
components | string | auto (default): repeated components printed once + per-instance overrides. inline: every instance expanded. names: instances as one line (when the codebase already has them). |
current_color | boolean | With assets_dir: monochrome SVG icons use currentColor (default false). |
depth | integer | Max levels to read below the target (default: all). |
expand_vectors | boolean | Describe the shapes inside icons/illustrations instead of one svg line (default false). |
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
include_hidden | boolean | Include hidden layers (default false). |
screenshot | boolean | Also return a PNG of the target (saves a separate get_screenshot call). |
target | string | Figma URL, node id(s) like "12:34" (comma-separated), or omit for the current selection in Figma. |
get_screenshot Screenshot
Renders the target as PNG image(s) you can look at. Wide renders are scaled to what vision can read; tall ones are split into tiles. Optionally saves the full-resolution PNG.
| Parameter | Type | Description |
|---|---|---|
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
save_to | string | Also write the PNG to this path (e.g. for visual tests). |
scale | number | Render scale (default: 2, reduced to fit 1568px wide). |
target | string | Figma URL, node id(s) like "12:34" (comma-separated), or omit for the current selection in Figma. |
export_assets Export assets
Writes the icons (SVG) and images (original files) used inside the target to a folder, deduplicated, and lists which file belongs to which layer / src hash. as:"svg"|"png" exports the target layers themselves instead.
| Parameter | Type | Description |
|---|---|---|
as | string | auto (default): every svg graphic + image fill inside the target. |
current_color | boolean | Replace the single colour of monochrome SVG icons with currentColor (default false). |
dir | string | Output folder (default "figma-assets" in the working directory). |
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
scale | number | PNG scale for as:"png" (default 2). |
target | string | Figma URL, node id(s) like "12:34" (comma-separated), or omit for the current selection in Figma. |
get_tokens Design tokens
The file's local variables (all modes) and styles — as a readable list, CSS custom properties, or JSON.
| Parameter | Type | Description |
|---|---|---|
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
filter | string | Only tokens whose name contains this. |
format | string | Default list. |
get_css Figma's CSS
Figma's own generated CSS (as in Dev Mode) for specific layers — a cross-check, not a layout description.
| Parameter | Type | Description |
|---|---|---|
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
target | string | Figma URL, node id(s) like "12:34" (comma-separated), or omit for the current selection in Figma. |
compare_screenshot Compare with implementation
Pixel-diffs your implementation against the Figma render of the target. Pass url (+ selector) to have Lupa render your running page at the design's width, or image = a PNG screenshot. Returns the mismatch %, the differing regions mapped to Figma layers, and a design | implementation | diff image.
| Parameter | Type | Description |
|---|---|---|
file | string | Which open Figma file (name or key) when several are connected. Default: the most recently active. |
image | string | Instead of url: path to a PNG screenshot of the implementation, cropped to the same element. |
save_diff | string | Also write the comparison image to this path. |
selector | string | CSS selector of the element to capture on that page (default: the full page). |
target | string | Figma URL, node id(s) like "12:34" (comma-separated), or omit for the current selection in Figma. |
threshold | number | Per-pixel colour tolerance 0–1 (default 0.1). |
url | string | Page with your implementation, e.g. http://localhost:5173/sheet. Rendered in headless Chromium at the design's width, 2x. |
wait_for | string | Selector to wait for before capturing (default: selector). |