Skip to main content
Glama

set_auto_layout

Add, change, or remove auto layout on Figma frames, components, and instances by setting gap, padding, sizing, wrap, and alignment; only provided options are updated.

Instructions

Add, change or remove auto layout on frames / components / instances. Only the options you pass are changed. gap: number, or 'AUTO' for space-between. padding: number | [vertical, horizontal] | [top,right,bottom,left] | {top,right,bottom,left}. primarySizing/counterSizing: HUG (auto) or FIXED. wrap (HORIZONTAL only) + counterGap = spacing between wrapped rows. mode NONE removes auto layout. Returns per-node results ({id, ok, ...} or {id, error}); one failing node does not abort the batch.

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": {
      "nodeIds": "<nodeIds>"
    },
    "name": "set_auto_layout"
  }
}

Input Schema

NameRequiredDescriptionDefault
gapNoItem spacing, or 'AUTO' = space between
fileNoTarget file (fileKey, id or name). Defaults to the most recently active file.
modeNo
wrapNoWrap children onto new rows (HORIZONTAL only)
nodeIdsYesFigma node ids, e.g. ['12:34']
paddingNonumber | [v,h] | [top,right,bottom,left] | {top,right,bottom,left} (object form sets only given sides)
counterGapNoSpacing between wrapped rows (requires wrap)
clipsContentNo
counterAlignNoAlignment across the layout direction (BASELINE: horizontal only)
primaryAlignNoAlignment along the layout direction
counterSizingNoSize across the layout direction
primarySizingNoSize along the layout direction
strokesIncludedInLayoutNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it states that the operation is a partial patch (only supplied options change), that mode NONE removes layout, and that results are per-node objects with {id, ok} or {id, error} while one failure does not abort the batch. It omits permissions/auth requirements and whether removals are reversible.

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

Conciseness5/5

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

Four dense sentences, front-loaded with the action, followed by patch semantics, parameter cheat-sheet, and return contract. Nothing is padded and the telegraphic style ('gap: number, or AUTO for space-between') maximizes signal per word.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete enough for a 13-parameter mutation tool with no annotations and no output schema — it explains the return shape itself and covers the highest-risk parameters. The gaps are secondary: a few layout parameters and any permissions or file-scoping notes are absent, though the file param is documented in the schema.

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 coverage is 77%, so the baseline is 3, but the description earns an extra point by explaining the semantics the schema only hints at: gap 'AUTO' means space-between, the four padding forms, HUG vs FIXED sizing, and the dependency of counterGap on wrap. It leaves clipsContent, primaryAlign, counterAlign, and strokesIncludedInLayout unmentioned beyond their schema enums.

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 opens with a specific verb+resource: adds, changes, or removes auto layout on frames/components/instances, and notes that mode NONE removes it. The scope is unmistakable, but it does not differentiate itself from the sibling set_layout_child, which an agent could plausibly confuse with it.

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?

It communicates useful application rules — only passed options change, wrap is HORIZONTAL only, BASELINE alignment is horizontal only — but these are param applicability constraints rather than when-to-use-this-tool-vs-alternatives guidance. There is no routing to set_layout_child or get_layout_tree.

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