Export design tokens (W3C DTCG)
figma_export_tokensExports Figma variables as W3C DTCG token files per collection and mode, plus a resolver for switching themes, enabling Style Dictionary to generate CSS, Swift, or Kotlin.
Instructions
Exports the file's variables as W3C Design Tokens (DTCG format 2025.10): one .tokens.json file per collection and mode, plus a .resolver.json whose modifiers switch modes (light/dark, brands, sizes). Colors become srgb color objects, spacing-like numbers become px dimensions, aliases become {group.token} references, and Figma scopes/code syntax go to $extensions. Feed the files to Style Dictionary or another DTCG tool to generate CSS, Swift or Kotlin. Works on any plan through the web source or the plugin.
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": {
"url": "<url>"
},
"name": "figma_export_tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | Output folder (created if missing) | design-tokens |
| url | Yes | Figma link, e.g. https://www.figma.com/design/<fileKey>/<name>?node-id=12-345 (right-click a layer > Copy link to selection). A bare file key also works. | |
| name | No | Design system name for the resolver file (default: the file name) | |
| source | No | Where to read from. auto (default): Figma's viewer protocol (no token, no Dev Mode), then the REST API if FIGMA_TOKEN is set, then the plugin. web/rest/plugin force one. | auto |
| theme_collections | No | Collections that are alternatives of each other, e.g. ["Tokens", "Tokens Dark"] on plans with one mode per collection; they become contexts of one "theme" modifier |