Extract Design Tokens
extract_tokensExtract design tokens from a Figma file and convert them to W3C, Style Dictionary, or raw formats for use in design systems and code.
Instructions
Extract design tokens (variables) from a Figma file and convert to standard formats.
Fetches all Figma Variables from the specified file and converts them to the requested format. Supports W3C Design Token Community Group format, Style Dictionary input format, or raw Figma API response.
Args:
figma_file_key (string): The Figma file key from the URL
collection_names (string[], optional): Filter to specific variable collections
output_format ('w3c' | 'style-dictionary' | 'raw'): Output format (default: 'w3c')
Returns: JSON with token data and summary statistics including counts by type and collection.
Examples:
"Extract all design tokens from our Figma file" → extract_tokens with just figma_file_key
"Get only color tokens" → extract_tokens with collection_names: ["Colors"]
"Export tokens for Style Dictionary pipeline" → extract_tokens with output_format: "style-dictionary"
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": {
"figma_file_key": "<figma_file_key>"
},
"name": "extract_tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_format | No | Output format: 'w3c' (W3C Design Token format), 'style-dictionary' (SD input format), or 'raw' (Figma API response) | w3c |
| figma_file_key | Yes | The Figma file key (from the URL: figma.com/design/{THIS_PART}/...) | |
| collection_names | No | Optional list of variable collection names to include. Omit to include all. |