mcp__getDesignSections
Fetch design sections overview or per-section DSL from MasterGo. Use without index to list sections with bounding boxes; use with sectionIndex to get detailed DSL for code generation.
Instructions
[PRIMARY] This is the main tool for all designs. Operates in TWO modes:
Mode 1 — Get layout overview (sectionIndex NOT provided): Returns the list of all sections with id, name, type, nodeCount, and a page-absolute bounding box (x, y, width, height) for each section, plus totalSections and totalNodes. Also returns rootMetadata (root layer width/height/name/type/fill) when available. Use this FIRST to understand the design scope. The per-section bbox tells you exactly where each section sits inside the root container — use it for absolute positioning when generating code. Example: { "fileId": "123", "layerId": "456:789" }
Mode 2 — Get section DSL (sectionIndex provided): Returns the full DSL for ONE specific section.
PATH nodes have their svgHtml stripped. After fetching ALL sections, call mcp__getDesignSvgs to retrieve them.
IMPORTANT workflow:
First call WITHOUT sectionIndex to get the section list with node counts.
Then call WITH sectionIndex=0, sectionIndex=1, ... up to totalSections-1.
You MUST fetch ALL sections. Do NOT skip any section index.
CRITICAL: Fetch sections in BATCHES of 3-5 at a time. Do NOT request all sections simultaneously — too many concurrent requests will cause timeouts. Send 3-5 sectionIndex calls, wait for all results, then send the next batch.
After fetching all sections, call mcp__getDesignSvgs to get SVG icons.
Generate the complete HTML with all SVG data.
DO NOT call mcp__getDsl after completing this workflow — all data is already provided. If this tool returns an error (e.g. old server), fall back to mcp__getDsl.
You can provide either:
fileId and layerId directly, or
a short link (like https://{domain}/goto/LhGgBAK)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fileId | No | MasterGo design file ID. Required if shortLink is not provided. | |
| format | No | Output format for design data. Defaults to json. - json — default; useful when piping output into tools that expect JSON. - yaml — fewer tokens than JSON for typical designs. - tree — experimental compact format. Structural keys (id, name, type) are encoded positionally on each node line, and style values stay deduplicated in a globalVars block. Designs with heavy style reuse see the largest token savings. | |
| layerId | No | Root layer ID of the design. Required if shortLink is not provided. | |
| shortLink | No | Short link (like https://{domain}/goto/LhGgBAK). | |
| sectionIndex | No | 0-based section index. If omitted, returns the section list only. If provided, returns full DSL for that specific section. | |
| sourceLayerId | No | Source layer ID from URL parameter source_layer_id. When provided, use this instead of layerId for all queries. |