Skip to main content
Glama

set_auto_layout

Set a frame's auto-layout: NONE disables; HORIZONTAL/VERTICAL enable flex with padding, spacing, alignment, wrap; GRID applies CSS-grid row/column gaps. Returns ok and node ID.

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?

The description discloses important behaviors: layoutMode NONE disables auto layout, it returns { ok, nodeId }, and it uses CSS analogues (row-gap, align-content) to explain cross-axis behavior. Since annotations only provide readOnlyHint=false and destructiveHint=false, this extra context is valuable. It does not cover error cases or side effects on existing layout properties, but it exceeds the minimum required.

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 a single dense sentence but uses semicolons and parentheses to organize the mode-specific parameter groups. It is front-loaded with the core purpose and delivers substantive detail without fluff. While it could be split into bullets for readability, every phrase serves a purpose.

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?

With 18 parameters and no output schema, this description needs to carry a lot of weight. It explains the main modes, return shape, and some parameter interactions, but it omits defaults, comprehensive enum explanations, and any mention of errors or prerequisites. The tool is complex enough that a longer description or examples would be warranted.

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%), so the description compensates by grouping parameters by mode and adding CSS context for counterAxisSpacing, counterAxisAlignContent, itemReverseZIndex, and strokesIncludedInLayout. It clarifies which parameters apply to which layout modes, which is critical for correct usage. However, it does not explain every parameter (e.g., primaryAxisAlignItems, counterAxisAlignItems, padding values), so it stops short of full compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Configure a frame's auto layout') and clearly enumerates the three layout modes (NONE, HORIZONTAL/VERTICAL, GRID) and their associated parameters. However, it does not explicitly distinguish itself from the overlapping sibling tool set_layout_props, so it misses the top score for sibling differentiation.

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 by detailing what each layout mode does, but it never explicitly states when to choose this tool over set_layout_props or set_layout_grids, nor does it mention any prerequisites (e.g., node must be a frame). The context is clear but no exclusions or alternatives are provided.

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