Skip to main content
Glama
OpenFigma MCP

OpenFigma MCP

by Shivam990q

generate_code

Generate production UI component code from a Figma design URL for React-Tailwind, Vue, Svelte, Angular, Solid, or HTML/CSS, with selectable framework output.

Instructions

Generates production UI component code for 9 frameworks (React-Tailwind, Vue, Svelte, Angular, Solid, HTML/CSS).

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

Input Schema

NameRequiredDescriptionDefault
urlYesFigma design URL
frameworkNoreact-tailwind

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden and does not meet it. It never says whether this is a read-only generation call or whether it writes to a canvas, whether it requires Figma authentication, or how long a generation takes — all material for a tool that fetches a remote design and emits code.

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

Conciseness3/5

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

It is a single front-loaded sentence with no filler, which is good. But the incorrect framework count makes the one clause it spends on specifics actively unreliable rather than informative.

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

Completeness2/5

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

There is no output schema and no annotations, so the description is the only place an agent could learn what comes back — a code string, a file path, or an inserted canvas node. That is entirely absent, as is any mention that the input must be a Figma design URL.

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 50%: 'url' is documented as a Figma design URL, while 'framework' has an enum and default but no description. The description partially compensates by enumerating framework names in prose, though its count ('9') conflicts with the six enum values.

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 states a specific verb and resource: it generates production UI component code, and it names the target frameworks. However, it says '9 frameworks' while listing only six, and the six it lists match the schema enum — so the count is factually wrong and could mislead an agent into expecting other options.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus the several sibling tools that also touch code (canvas_insert_code, transpile_code_to_canvas, get_code_connect). Nothing states prerequisites, such as needing a Figma URL versus a node ID or an existing canvas frame.

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