figma_get_variables
Extract design tokens from Figma files, including collections, modes, and resolved aliases. Output as JSON, CSS custom properties, or W3C DTCG format.
Instructions
Design variables (tokens) with collections, modes, per-mode values and resolved aliases. Works on any plan (no Enterprise REST API). Formats: json (default), css (custom properties, extra modes as [data-collection=mode]), dtcg (W3C design tokens). A file that defines none answers empty in that format; figma_token_usage derives tokens from the raw values instead, and figma_get_styles reads the styles.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Path to a local .fig file, or a Figma file key / figma.com/design/... URL. A node-id in the URL is used when this tool takes node_id and it is omitted; a tool that answers about the whole file ignores it. A key or URL uses a local '<name> [<key>].fig' from FIGMA_FILES_DIRS when one exists, otherwise exports through the browser. | |
| format | No | ||
| refresh | No | Skip local/cached copies and export the live file through the browser. Has no effect when file is a path to a .fig: that file is read as it is on disk and the result carries refreshIgnored; pass the key or URL to export the live file instead. | |
| out_file | No | Also write the result to this path | |
| collection | No | Only this collection name; a name no collection in the file has is an error listing the ones it has | |
| css_prefix | No | ||
| include_remote | No | Include library variables copied into the file (default true) |