xd_export_artboard
Exports an artboard or sub-layer as clean JSON with frames, text, fills, effects, and transforms for rebuilding the design in Figma or another tool.
Instructions
Full-fidelity export of one artboard (or a sub-layer via nodeId) as clean JSON for rebuilding the design in another tool such as Figma: frames, rectangles (with corner radius), ellipses, lines, vector paths (SVG path data), boolean shapes, text (font, size, styled runs), fills (solid/gradient/image), strokes, shadows/effects, opacity, rotation, constraints, components, repeat grids and layout grids. Linked components (syncRef) are resolved to their real content. Text is normalised (top-left box, baselineY, line breaks as , alignment, autoResize, underline runs). The full transform matrix is given with transformOrigin top-left. Positions are relative to the parent; masks are in the masked group's local space. Images are referenced by imageRef; pass assetsDir to save them. Big screens are split into pages (page / pageCount / hasMore); each page lists whole top-level layers. Use nodeId to drill into one layer.
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>",
"artboard": "<artboard>"
},
"name": "xd_export_artboard"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute path to a .xd file | |
| page | No | Page of a large export (see pageCount / hasMore in the result). | |
| depth | No | Max nesting depth (default: everything). Layers below the limit are marked truncated:true; nothing is ever cut silently. | |
| nodeId | No | Export only this layer id (from a previous export) | |
| artboard | Yes | Artboard id or name | |
| assetsDir | No | Optional absolute folder (inside the allowed roots). Referenced images are saved there as <imageRef>.<ext>. | |
| semanticNames | No | Add suggestedName to every layer (numeric suffixes stripped, text-based names). |