Skip to main content
Glama
OpenFigma MCP

OpenFigma MCP

by Shivam990q

canvas_insert_code

Convert HTML, JSX, or Tailwind snippets into native layers directly on the live Figma canvas. Insert code as editable design elements without manual rebuilding.

Instructions

Transpiles HTML / JSX / Tailwind code and immediately instantiates it as native layers on the live Figma canvas.

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": {
      "code": "<code>"
    },
    "name": "canvas_insert_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesHTML, JSX, or Tailwind snippet to draw on canvas

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.4/5.0
Behavior3/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. It usefully discloses that the operation mutates the live Figma canvas immediately (a real side effect), but is silent on permissions required, whether existing content is affected, reversibility, and failure behavior — meaningful gaps for a live-write tool.

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

Conciseness5/5

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

A single front-loaded sentence with zero filler; the transformation and the effect are stated in one pass. Nothing could be removed without losing information.

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

Completeness3/5

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

With no annotations and no output schema, the description should say more about what results (node IDs, created frame, selection state) or how errors surface. It covers input and effect adequately but leaves the agent without any notion of the return value or post-call state.

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?

Only one parameter, and the schema already documents it at 100% coverage ("HTML, JSX, or Tailwind snippet to draw on canvas"). The description reinforces the accepted input dialects (HTML / JSX / Tailwind) without adding contradictions, but adds no format or size constraints beyond the schema.

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?

Uses a specific verb pair ("transpiles... and immediately instantiates") plus a precise resource ("native layers on the live Figma canvas"), so the agent knows it renders code into the live Figma document rather than just transforming it. It does not, however, distinguish itself from siblings with similar names such as transpile_code_to_canvas or render_svg, leaving overlap for the agent to resolve.

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 explicit when-to-use, when-not-to-use, or alternative-routing guidance. "Immediately instantiates... on the live canvas" hints at the write-to-live-document case, but nothing tells the agent why to pick this over transpile_code_to_canvas or canvas_create_frame.

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