Skip to main content
Glama
atezer

F-MCP (Figma MCP Bridge)

by atezer

figma_extract_contract

Read-only

Extracts a complete design contract JSON from Figma components, covering props, anatomy, variant overrides, resolved tokens, and a11y contrast pairs for design-to-code handoff or component docs.

Instructions

Extract a complete design contract JSON spec from a COMPONENT_SET (or a COMPONENT/INSTANCE inside one). Reads props (componentPropertyDefinitions with boolean-like variant + state normalization), anatomy (default variant tree with token bindings mapped to CSS properties), variantOverrides (token diffs of every variant value vs the default variant), resolvedTokens (per-mode values with alias chains), baseSpecs (raw measurements) and a11y contrast pairs (WCAG AA/AAA per mode). nodeId omitted → current Figma selection. DS-agnostic; no REST API. Returns { success, contract, report } — contract status is 'draft', anchors.code needs manual verification. Use for design-to-code handoff, DS documentation, or as the source of truth for component codegen.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdNoCOMPONENT_SET / COMPONENT / INSTANCE node ID. Omit to use the current selection.
fileKeyNoTarget a specific connected file.
figmaUrlNoFigma file URL for routing.
importPathTemplateNoanchors.code.importPath template; {Name} → PascalCase component name. Default '@ds/components/{Name}'.
Behavior5/5

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

Annotations declare readOnlyHint=true, and the description aligns with that by saying 'Reads' and 'no REST API', so no contradiction. It adds significant behavioral context: the tool falls back to the current Figma selection when nodeId is omitted, returns a structured { success, contract, report } object, and flags that the contract status is 'draft' with anchors.code requiring manual verification. These details go well beyond the annotation and are crucial for correct invocation and interpretation.

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?

The description is a dense paragraph of about 80 words, but every sentence contributes value: it lists the extracted data, the selection fallback, the return shape, the draft status, and the use cases. It is front-loaded with the core purpose ('Extract a complete design contract JSON spec'). For a tool of this complexity, the length is appropriate, though it could be slightly more scannable with bullet points.

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?

The tool is complex with no output schema, yet the description covers the key aspects: the input node type, the data sections included, the top-level return shape, the contract status caveat, and the intended use cases. It does not describe the internal structure of each section (e.g., anatomy), but the enumerated list of sections gives an agent enough to know what to expect. Given the read-only annotation and the rich description, it is quite complete but not exhaustive.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds extra meaning for one parameter by explicitly stating 'nodeId omitted → current Figma selection', which clarifies the optionality and behavior beyond the schema description. It also mentions the importPathTemplate default indirectly via 'anchors.code.importPath template', but that is already in the schema. Overall, it provides meaningful augmentation, justifying a 4.

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

Purpose5/5

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

The description clearly states a specific verb ('Extract') and a precise resource ('a complete design contract JSON spec from a COMPONENT_SET'). It enumerates the exact data read (props, anatomy, variantOverrides, resolvedTokens, baseSpecs, a11y pairs), which distinguishes it from sibling tools like figma_get_component_for_development or figma_get_design_context. The mention of 'DS-agnostic; no REST API' further differentiates it from figma_rest_api.

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

Usage Guidelines4/5

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

The description explicitly provides use cases: 'design-to-code handoff, DS documentation, or as the source of truth for component codegen.' This gives clear context for when to employ the tool. It does not explicitly name alternative tools to use instead for other scenarios, but the use-case framing is sufficiently informative for an agent to decide.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/atezer/FMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server