Skip to main content
Glama

Generate Theme Config

generate_theme_config
Read-onlyIdempotent

Generate theme-aware CSS, Tailwind, or TypeScript ThemeProvider files from Figma Variable modes to keep Light/Dark themes consistent across design and code.

Instructions

Extract multi-theme configurations from Figma Variable modes.

Generates theme-aware output files (CSS custom properties with theme selectors, Tailwind config, or TypeScript ThemeProvider) from Figma Variable modes (Light/Dark/etc).

Args:

  • figma_file_key (string): The Figma file key

  • output_format ('css' | 'tailwind' | 'theme-provider' | 'all'): Output format (default: 'css')

  • color_scheme_strategy ('data-attribute' | 'media-query' | 'class'): CSS selector strategy (default: 'data-attribute')

  • default_mode (string, optional): Override base theme mode name

Returns: JSON with generated file(s) and summary of modes/token counts.

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": "generate_theme_config"
  }
}

Input Schema

NameRequiredDescriptionDefault
default_modeNoOverride which mode is the base theme (auto-detects if omitted)
output_formatNoOutput format (default: 'css')css
figma_file_keyYesThe Figma file key (from the URL: figma.com/design/{THIS_PART}/...)
color_scheme_strategyNoCSS selector strategy for themes (CSS format only, default: 'data-attribute')data-attribute

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds real value on top: it enumerates the three output shapes, discloses that color_scheme_strategy applies only to CSS format, and states the return payload contains generated file(s) plus a mode/token summary. That last point usefully clarifies it returns content rather than persisting files, consistent with readOnlyHint. Not addressed: whether anything is written to disk or failure modes for files without Variable modes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded, then Args, then Returns — a scannable structure with no filler prose. It loses a point for the Args section duplicating schema defaults verbatim, which is redundant given the schema is fully described.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description steps in to describe the return shape (generated files plus a mode/token count summary), which is exactly the missing piece an agent needs. For a four-parameter generation tool with full schema coverage, the remaining gap is narrow — mainly error behavior and whether output is ever written out.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so every parameter is already documented, including enums, defaults, and the CSS-only caveat for color_scheme_strategy. The Args block largely restates the schema with no added semantics, such as what 'all' produces or how default_mode interacts with auto-detection. Baseline 3 applies when the schema carries the load.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Extract multi-theme configurations from Figma Variable modes', and elaborates on the concrete artifacts produced (CSS custom properties, Tailwind config, TypeScript ThemeProvider). This is far more specific than a name restatement and separates it from generic token extraction. It stops short of naming a sibling to contrast with, so it lands at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the required figma_file_key and the note that modes are Light/Dark/etc., so an agent can infer this is the tool for theme-scoped generation. However there is no explicit when-to-use versus when-not guidance, and no mention of how it relates to siblings like extract_tokens or sync_tokens_to_code, which also touch themeable output.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.