Skip to main content
Glama

export

Render a Figma node from a saved .fig file to SVG, PNG, JPG, WebP or AVIF, using scale, quality and size limits to produce website assets or inline images.

Instructions

Export a node to SVG, PNG, JPG, WebP or AVIF. Create the output directory first. Returns metadata and, for raster formats, an inline image. PNG suits inline references: up to 4,194,304 pixels it is losslessly optimized with exact decoded RGBA, keeping original encoded bytes unless smaller; larger PNGs keep regular encoding. For website assets, follow the target project's existing image pipeline; otherwise start with WebP for bitmaps, sized for display dimensions and DPR using scale/maxSize and quality/maxKb. SVG embeds original images and can be large; keep it for vector artwork. When inlining or optimizing SVG, keep its root transform and unique ids (SVGO: prefixIds, not cleanupIds). The export covers what the node draws; bounds: layout exports the layout box, and warnings report when the two differ, any known skipped or approximated rendering in the subtree, as bundle warnings do, and images or components the file lacks. scale, quality and maxSize affect raster formats only; maxSize defaults to 1600. Check returned dimensions/bytes and isError; read content on failure.

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": {
      "file": "<file>",
      "node": "<node>",
      "out": "<out>"
    },
    "name": "export"
  }
}

Input Schema

NameRequiredDescriptionDefault
outYesoutput path ending in .png, .jpg, .jpeg, .webp, .avif or .svg; shipped assets follow the project's asset conventions, reference and scratch files go in .figlens/exports/ under the project root, created with a .gitignore containing * so it stays out of Git; create the parent directory first
fileYesthe saved .fig: a local path (absolute recommended), or gs://bucket/object using gcloud; remote sources are unavailable with --root
hideNocomma-separated ids of layers inside node to draw as hidden, over the same area (reply lists hidden); compare with the plain export to see where that layer, as figlens draws it, changes the result; no difference does not prove its skipped rendering harmless (it may match what is beneath it)
nodeYesa stored node id (12:345 or 12-345), full instance sublayer id (I12:345;67:89) from inspect/nodes, or a Figma URL with ?node-id=
maxKbNoKiB (1024 bytes) budget; lower lossy quality until it fits; PNG/SVG fail if over budget
scaleNodefault 1
boundsNorender (default): what the node draws, shadows, outside strokes and overflowing children included, as Figma's Export panel; layout: the node's own box (absoluteBoundingBox), cutting off what is drawn past itrender
maxSizeNolongest side in pixels, default 1600; 0 keeps the scaled size
qualityNo1-100, default 80
matchDirNoSVG output only: a folder of SVG files, subfolders included, to compare with the export, to find an icon the project already has; matches lists the files (relative paths) that draw the same outlines once both are moved to the origin, ignoring paint, ids and path syntax; similar lists up to 10 others with a similar shape (drawn with strokes, or the same outlines at another size, which score 1) as {file, score} from 0.8, best first; confirm a similar file by looking at both

Output Schema

NameRequiredDescriptionDefault
pathYes
bytesYes
widthYes
heightYes
hiddenNowith hide: the layers drawn as hidden
matchesNowith matchDir: files there (relative paths) that draw the same outlines
qualityYesthe quality used; --max-kb may lower it
similarNowith matchDir: up to 10 other files with a similar shape as {file, score}, score 0.8-1, best first; not proof of the same icon
warningsNofirst, when the drawn area differs from the layout box, how far it reaches past each side, what draws there when known, and which box was exported; then one `Render <state> at node <id> (<field>): <reason>` line per background blur this render left out at its blur limit and per known skipped or approximated rendering in the subtree, as in bundle warnings; then one line per visible image paint whose bytes the file lacks (`Image <ref> at node <id> is not in the .fig; it is drawn empty`) and per instance whose component it lacks (`Component <id> of instance <id> is not in the .fig; ...`), as in a .fig from `figlens clipboard`; empty when none applies
layoutBoxNoabsoluteBoundingBox in page coordinates
renderBoxNoabsoluteRenderBounds in page coordinates

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.14.4
    • changedOutput schema / properties / warnings / description
      Previous value: -"first, when the drawn area differs from the layout box, how far it reaches past each side, what draws there when known, and which box was exported; then one `Render <state> at node <id> (<field>): <reason>` line per known skipped or approximated rendering in the subtree, as in bundle warnings; then one line per visible image paint whose bytes the file lacks (`Image <ref> at node <id> is not in the .fig; it is drawn empty`) and per instance whose component it lacks (`Component <id> of instance <id> is not in the .fig; ...`), as in a .fig from `figlens clipboard`; empty when none applies"New value: +"first, when the drawn area differs from the layout box, how far it reaches past each side, what draws there when known, and which box was exported; then one `Render <state> at node <id> (<field>): <reason>` line per background blur this render left out at its blur limit and per known skipped or approximated rendering in the subtree, as in bundle warnings; then one line per visible image paint whose bytes the file lacks (`Image <ref> at node <id> is not in the .fig; it is drawn empty`) and per instance whose component it lacks (`Component <id> of instance <id> is not in the .fig; ...`), as in a .fig from `figlens clipboard`; empty when none applies"
  2. Changed1 schema field changedv0.13.1
    • changedOutput schema / properties / warnings / description
      Previous value: -"first, when the drawn area differs from the layout box, how far it reaches past each side, what draws there when known, and which box was exported; then one `Render <state> at node <id> (<field>): <reason>` line per known skipped or approximated rendering in the subtree, as in bundle warnings; empty when neither applies"New value: +"first, when the drawn area differs from the layout box, how far it reaches past each side, what draws there when known, and which box was exported; then one `Render <state> at node <id> (<field>): <reason>` line per known skipped or approximated rendering in the subtree, as in bundle warnings; then one line per visible image paint whose bytes the file lacks (`Image <ref> at node <id> is not in the .fig; it is drawn empty`) and per instance whose component it lacks (`Component <id> of instance <id> is not in the .fig; ...`), as in a .fig from `figlens clipboard`; empty when none applies"
  3. Changed6 schema fields changedv0.11.3
    • addedInput schema / properties / hide
      Added value: +{
      +  "description": "comma-separated ids of layers inside node to draw as hidden, over the same area (reply lists hidden); compare with the plain export to see where that layer, as figlens draws it, changes the result; no difference does not prove its skipped rendering harmless (it may match what is beneath it)",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / matchDir
      Added value: +{
      +  "description": "SVG output only: a folder of SVG files, subfolders included, to compare with the export, to find an icon the project already has; matches lists the files (relative paths) that draw the same outlines once both are moved to the origin, ignoring paint, ids and path syntax; similar lists up to 10 others with a similar shape (drawn with strokes, or the same outlines at another size, which score 1) as {file, score} from 0.8, best first; confirm a similar file by looking at both",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedOutput schema / properties / hidden
      Added value: +{
      +  "description": "with hide: the layers drawn as hidden",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / matches
      Added value: +{
      +  "description": "with matchDir: files there (relative paths) that draw the same outlines",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / similar
      Added value: +{
      +  "description": "with matchDir: up to 10 other files with a similar shape as {file, score}, score 0.8-1, best first; not proof of the same icon",
      +  "items": {
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / warnings / description
      Previous value: -"empty unless the drawn area differs from the layout box; then how far it reaches past each side, what draws there when known, and which box was exported"New value: +"first, when the drawn area differs from the layout box, how far it reaches past each side, what draws there when known, and which box was exported; then one `Render <state> at node <id> (<field>): <reason>` line per known skipped or approximated rendering in the subtree, as in bundle warnings; empty when neither applies"
  4. Changed7 schema fields changedv0.9.3
    • changedInput schema / additionalProperties
      Previous value: -trueNew value: +false
    • addedInput schema / properties / bounds
      Added value: +{
      +  "default": "render",
      +  "description": "render (default): what the node draws, shadows, outside strokes and overflowing children included, as Figma's Export panel; layout: the node's own box (absoluteBoundingBox), cutting off what is drawn past it",
      +  "enum": [
      +    "render",
      +    "layout"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / maxKb / maximum
      Previous value: -18014398509481984New value: +9007199254740991
    • changedInput schema / properties / out / description
      Previous value: -"output path ending in .png, .jpg, .jpeg, .webp, .avif or .svg; create the parent directory first"New value: +"output path ending in .png, .jpg, .jpeg, .webp, .avif or .svg; shipped assets follow the project's asset conventions, reference and scratch files go in .figlens/exports/ under the project root, created with a .gitignore containing * so it stays out of Git; create the parent directory first"
    • addedOutput schema / properties / layoutBox
      Added value: +{
      +  "description": "absoluteBoundingBox in page coordinates",
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / renderBox
      Added value: +{
      +  "description": "absoluteRenderBounds in page coordinates",
      +  "type": [
      +    "object",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "description": "empty unless the drawn area differs from the layout box; then how far it reaches past each side, what draws there when known, and which box was exported",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  5. Changed17 schema fields changedv0.7.2
    • addedInput schema / additionalProperties
      Added value: +true
    • changedInput schema / properties / file / description
      Previous value: -"the .fig file (File > Save local copy): an absolute path, or gs://bucket/object"New value: +"the saved .fig: a local path (absolute recommended), or gs://bucket/object using gcloud; remote sources are unavailable with --root"
    • addedInput schema / properties / file / minLength
      Added value: +1
    • changedInput schema / properties / maxKb / description
      Previous value: -"lower lossy quality until the file fits; PNG/SVG fail if over budget"New value: +"KiB (1024 bytes) budget; lower lossy quality until it fits; PNG/SVG fail if over budget"
    • addedInput schema / properties / maxKb / maximum
      Added value: +18014398509481984
    • addedInput schema / properties / maxKb / minimum
      Added value: +0
    • addedInput schema / properties / maxSize / default
      Added value: +1600
    • addedInput schema / properties / maxSize / maximum
      Added value: +4294967295
    • addedInput schema / properties / maxSize / minimum
      Added value: +0
    • changedInput schema / properties / node / description
      Previous value: -"a node id (12:345 or 12-345) or a Figma URL with ?node-id="New value: +"a stored node id (12:345 or 12-345), full instance sublayer id (I12:345;67:89) from inspect/nodes, or a Figma URL with ?node-id="
    • changedInput schema / properties / out / description
      Previous value: -"absolute path ending in .png, .jpg, .webp, .avif or .svg"New value: +"output path ending in .png, .jpg, .jpeg, .webp, .avif or .svg; create the parent directory first"
    • addedInput schema / properties / out / minLength
      Added value: +1
    • addedInput schema / properties / quality / default
      Added value: +80
    • addedInput schema / properties / quality / maximum
      Added value: +100
    • addedInput schema / properties / quality / minimum
      Added value: +1
    • addedInput schema / properties / scale / default
      Added value: +1
    • addedInput schema / properties / scale / exclusiveMinimum
      Added value: +0
  6. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / maxSize
      Added value: +{
      +  "description": "longest side in pixels, default 1600; 0 keeps the scaled size",
      +  "type": "integer"
      +}
  7. First observed

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the load and does disclose real behavior: it writes files ('Create the output directory first'), returns metadata plus an inline image for raster formats, emits warnings for skipped or approximated rendering, and notes PNG/SVG fail if over a maxKb budget. It also tells the agent to check returned dimensions/bytes and isError. It stops short of stating permission requirements or idempotency/overwrite behavior for an existing output path.

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?

Purpose is front-loaded in the first sentence, which is good, but the body becomes a dense run-on mixing PNG encoding internals (the 4,194,304-pixel lossless threshold, decoded RGBA bytes), SVGO id-preservation advice, and bounds semantics. Much of it is genuinely useful, but the PNG byte-level detail and the SVGO aside read as trivia that slows an agent scanning for the call decision.

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?

For a 10-parameter tool with no annotations, the description covers the important gaps: output-directory prerequisite, format trade-offs, bounds behavior, warning reporting, and failure checking, while the output schema and 100%-covered input schema handle return shape and per-parameter details. Only overwrite/permission semantics are left unstated.

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 coverage is 100%, so the baseline is 3; the description earns above that by adding cross-parameter meaning not captured per-property: 'scale, quality and maxSize affect raster formats only' and the maxSize default of 1600. It also clarifies the render-vs-layout bounds distinction in operational terms (export panel semantics vs. cutting off overflow).

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?

Opens with a specific verb and resource ('Export a node') and immediately enumerates the output formats (SVG, PNG, JPG, WebP, AVIF). An agent can tell this is the single-node image exporter, distinct from a batch exporter or image comparator, without opening the schema.

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?

Gives substantive format-selection guidance: PNG for inline references, WebP for bitmaps sized to display dimensions and DPR, SVG reserved for vector artwork, and 'follow the target project's existing image pipeline' when one exists. It does not explicitly route to sibling tools (e.g., export_batch for multiple nodes), so it falls short of full when/when-not/alternative coverage.

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