Skip to main content
Glama

set_auto_layout

Configure a frame's layout: disable auto layout, enable flexible (horizontal/vertical) layout with spacing and wrap, or apply CSS-grid layout with row and column settings.

Instructions

Configure a frame's auto layout. layoutMode NONE disables it; HORIZONTAL/VERTICAL enable flex (padding / itemSpacing / alignment / wrap, plus counterAxisSpacing / counterAxisAlignContent for the wrapped cross axis — the CSS row-gap / align-content — and itemReverseZIndex / strokesIncludedInLayout for paint order and stroke-in-layout); GRID enables CSS-Grid-style layout (padding / gridRowCount / gridColumnCount / gridRowGap / gridColumnGap). Returns { ok, nodeId }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYes
gridRowGapNo
layoutModeYes
layoutWrapNo
paddingTopNo
itemSpacingNo
paddingLeftNo
gridRowCountNo
paddingRightNo
gridColumnGapNo
paddingBottomNo
gridColumnCountNo
itemReverseZIndexNoPaint later siblings UNDER earlier ones (reversed canvas order) — the stacked-avatars / overlapping-cards pattern, usually with negative itemSpacing. HORIZONTAL/VERTICAL only
counterAxisSpacingNoCross-axis gap between wrapped rows (px) — the CSS row-gap when it differs from itemSpacing (gap: 16px 8px). Requires layoutWrap WRAP (settable in the same call)
counterAxisAlignItemsNo
primaryAxisAlignItemsNo
counterAxisAlignContentNoHow wrapped rows distribute along the cross axis: AUTO packs them at counterAxisSpacing, SPACE_BETWEEN spreads them (align-content). Requires layoutWrap WRAP
strokesIncludedInLayoutNoMake strokes take up layout space (gaps/padding grow by the stroke weight); Figma defaults to excluding them. HORIZONTAL/VERTICAL only
Behavior4/5

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

Annotations indicate the tool is not read-only and not destructive. The description adds behavioral context beyond annotations: it notes that layoutMode NONE disables auto layout, describes what each mode changes (e.g., flex vs CSS-Grid), and explains the return format ({ ok, nodeId }). It also clarifies behavior of specific parameters like itemReverseZIndex and strokesIncludedInLayout.

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

Conciseness4/5

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

The description is moderately long but well-structured, with the main purpose upfront and details organized by mode. Each sentence contributes value, though some parenthetical expansions could be more concise.

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?

Given the tool's complexity (18 parameters, no output schema), the description covers key modes and parameters but omits details like required parameters (nodeId, layoutMode), all alignment enum values, and error conditions. The return format is mentioned but not fully explained.

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 description coverage is low (22%), but the description compensates by grouping parameters by layout mode and explaining their function (e.g., counterAxisSpacing as 'CSS row-gap', itemReverseZIndex for stacked avatars). It covers all major parameter groups (padding, spacing, wrap, grid counts/gaps) but lacks individual details for some numeric parameters.

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?

The description clearly states the tool's purpose: 'Configure a frame's auto layout.' It specifies the resource (frame) and action (configuring auto layout), and distinguishes between three layout modes (NONE, HORIZONTAL/VERTICAL, GRID) with their associated parameters. This provides a specific verb+resource and differentiates from sibling tools like set_layout_props.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage (when you want to set auto layout on a frame) but lacks explicit guidance on when to use this tool versus alternatives like set_layout_grids or set_layout_props. It does not mention when not to use it or provide alternative tool names.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/awdr74100/figwright'

If you have feedback or need assistance with the MCP directory API, please join our Discord server