Lint & Export
Tools for linting designs and auto-fixing issues
2 tools in this domain.
lint_node
Section titled “lint_node”Run design linter on a node tree. Returns issues grouped by category with affected node IDs and fix instructions. Lint child nodes individually for large trees.
| Parameter | Type | Required | Description |
|---|---|---|---|
nodeId | string | ✗ | Node ID to lint. Omit to lint current selection. |
rules | string[] | ✗ | Rules to run. Default: ["all"]. Options: no-autolayout, shape-instead-of-frame, hardcoded-color, no-text-style, fixed-in-autolayout, default-name, empty-container, stale-text-name, no-text-property, all, wcag-contrast, wcag-contrast-enhanced, wcag-non-text-contrast, wcag-target-size, wcag-text-size, wcag-line-height, wcag |
maxDepth | number | ✗ | Max depth to recurse (default: 10) |
maxFindings | number | ✗ | Stop after N findings (default: 50) |
JSON Schema
{
"type": "object",
"properties": {
"nodeId": {
"description": "Node ID to lint. Omit to lint current selection.",
"type": "string"
},
"rules": {
"description": "Rules to run. Default: [\"all\"]. Options: no-autolayout, shape-instead-of-frame, hardcoded-color, no-text-style, fixed-in-autolayout, default-name, empty-container, stale-text-name, no-text-property, all, wcag-contrast, wcag-contrast-enhanced, wcag-non-text-contrast, wcag-target-size, wcag-text-size, wcag-line-height, wcag",
"type": "array",
"items": {
"type": "string",
"enum": [
"no-autolayout",
"shape-instead-of-frame",
"hardcoded-color",
"no-text-style",
"fixed-in-autolayout",
"default-name",
"empty-container",
"stale-text-name",
"no-text-property",
"wcag-contrast",
"wcag-contrast-enhanced",
"wcag-non-text-contrast",
"wcag-target-size",
"wcag-text-size",
"wcag-line-height",
"wcag",
"all"
]
}
},
"maxDepth": {
"description": "Max depth to recurse (default: 10)",
"type": "number"
},
"maxFindings": {
"description": "Stop after N findings (default: 50)",
"type": "number"
}
}
} Response reference only — not included in tool definitions
| Field | Type | Description |
|---|---|---|
nodeId | string | |
nodeName | string | |
categories | object[] | |
↳ rule | string | Lint rule name |
↳ count | number | |
↳ fix | string | Human-readable fix instructions |
↳ nodes | object[] | Affected nodes with rule-specific extra fields |
↳ id | string | |
↳ name | string | |
warning | string | Present when results truncated |
Example response
{
"nodeId": "1:2",
"nodeName": "Card",
"categories": [
{
"rule": "hardcoded-color",
"count": 2,
"fix": "Use set_fill_color with styleName or set_variable_binding.",
"nodes": [
{
"id": "1:5",
"name": "Background",
"hex": "#3b82f6",
"property": "fill",
"matchType": "style",
"matchName": "Primary/Blue"
}
]
}
]
} Response JSON Schema
{
"type": "object",
"properties": {
"nodeId": {
"type": "string"
},
"nodeName": {
"type": "string"
},
"categories": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rule": {
"type": "string",
"description": "Lint rule name"
},
"count": {
"type": "number"
},
"fix": {
"type": "string",
"description": "Human-readable fix instructions"
},
"nodes": {
"type": "array",
"description": "Affected nodes with rule-specific extra fields",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
}
}
}
}
},
"warning": {
"type": "string",
"description": "Present when results truncated"
}
},
"required": [
"nodeId",
"nodeName",
"categories"
]
} lint_fix_autolayout
Section titled “lint_fix_autolayout” edit
Auto-fix: convert frames with multiple children to auto-layout. Takes node IDs from lint_node 'no-autolayout' results.
| Parameter | Type | Required | Description |
|---|---|---|---|
items | object[] | ✓ | Array of frames to convert to auto-layout |
↳ nodeId | string | ✓ | Node ID |
↳ layoutMode | "HORIZONTAL" | "VERTICAL" | ✗ | Layout direction (default: auto-detect based on child positions) |
↳ itemSpacing | number | ✗ | Spacing between children (default: 0) |
depth | number | ✗ | Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited. |
JSON Schema
{
"type": "object",
"properties": {
"items": {
"description": "Array of frames to convert to auto-layout",
"type": "array",
"items": {
"type": "object",
"properties": {
"nodeId": {
"type": "string",
"description": "Node ID"
},
"layoutMode": {
"description": "Layout direction (default: auto-detect based on child positions)",
"type": "string",
"enum": [
"HORIZONTAL",
"VERTICAL"
]
},
"itemSpacing": {
"description": "Spacing between children (default: 0)",
"type": "number"
}
},
"required": [
"nodeId"
]
}
},
"depth": {
"description": "Response detail: omit for id+name only. 0=properties + child stubs. N=recurse N levels. -1=unlimited.",
"type": "number"
}
},
"required": [
"items"
]
} Response reference only — not included in tool definitions
| Field | Type | Description |
|---|---|---|
results | (success | error)[] | Per-item results. |
↳ layoutMode | "VERTICAL" | "HORIZONTAL" | |
↳ skipped | boolean | True if node already has auto-layout |
↳ reason | string | Reason for skipping |
↳ error | string | Error message for this item |
warnings | string[] | Deduplicated warnings hoisted from individual results |
Example response
{
"results": [
{
"layoutMode": "VERTICAL"
},
{
"skipped": true,
"reason": "Already has auto-layout"
}
]
} Response JSON Schema
{
"type": "object",
"properties": {
"results": {
"type": "array",
"description": "Per-item results.",
"items": {
"oneOf": [
{
"title": "success",
"type": "object",
"properties": {
"layoutMode": {
"type": "string",
"enum": [
"VERTICAL",
"HORIZONTAL"
]
},
"skipped": {
"type": "boolean",
"description": "True if node already has auto-layout"
},
"reason": {
"type": "string",
"description": "Reason for skipping"
}
}
},
{
"title": "error",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message for this item"
}
},
"required": [
"error"
]
}
]
}
},
"warnings": {
"type": "array",
"description": "Deduplicated warnings hoisted from individual results",
"items": {
"type": "string"
}
}
},
"required": [
"results"
]
}