Skip to main content
Glama

set_layout_props

Set auto-layout sizing, alignment, and position properties on a Figma node. Control HUG, FILL, FIXED sizing, bounds, and absolute positioning.

Instructions

Set a node's auto-layout sizing and child properties. layoutSizingHorizontal / layoutSizingVertical (HUG = shrink to fit children, FILL = stretch to fill the auto-layout parent, FIXED = keep the current size) are the preferred way to size a frame to its content (HUG) or make a child fill its container (FILL) — reach for these instead of guessing pixel sizes with resize_nodes. layoutAlign (STRETCH = fill the counter axis, INHERIT = default) and layoutGrow (1 = fill the primary axis, 0 = hug) are the older per-axis equivalents. layoutPositioning (ABSOLUTE = ignore the flow and position freely, AUTO = participate in layout). minWidth / maxWidth / minHeight / maxHeight set responsive size bounds (→ min-w / max-w); pass null to clear a bound. Bounds apply to auto-layout frames and their direct children. HUG needs an auto-layout frame (or text); FILL needs an auto-layout parent. Any field may be omitted to leave it unchanged. Returns { ok, nodeId }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesNode id — an auto-layout frame, or a child inside one
maxWidthNoMaximum width in px (null clears the bound)
minWidthNoMinimum width in px (null clears the bound)
maxHeightNoMaximum height in px (null clears the bound)
minHeightNoMinimum height in px (null clears the bound)
layoutGrowNo1 = grow to fill the primary axis, 0 = hug content
layoutAlignNoCounter-axis alignment; STRETCH fills the counter axis
layoutPositioningNoABSOLUTE takes the node out of the auto-layout flow
layoutSizingVerticalNoVertical sizing: HUG fits content, FILL fills the parent, FIXED keeps height
layoutSizingHorizontalNoHorizontal sizing: HUG fits content, FILL fills the parent, FIXED keeps width
Behavior4/5

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

Annotations indicate it's a write operation (readOnlyHint=false) and non-destructive. The description confirms setting properties and notes any field can be omitted to leave unchanged, plus returns {ok, nodeId}. It adds context about property behaviors (e.g., null clears bounds) beyond annotations. No contradictions; it is transparent about the mutation and return value.

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 front-loaded with purpose and then systematically covers each property. It uses parenthetical explanations for enum values, keeping them inline. While long, every sentence adds value and it avoids repetition. Minor room for tighter phrasing (e.g., combining the two sentences about older equivalents), but overall well-organized for the complexity.

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

Completeness5/5

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

Given the tool has 10 parameters, no output schema, and no nested objects, the description covers all parameters, their usage, preconditions, and return value. It also includes usage guidelines and sibling differentiation. No important aspect is missing; it fully equips an agent to invoke the tool correctly.

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 100%, so baseline is 3. The description adds significant meaning by grouping properties (e.g., layoutSizing as preferred, layoutAlign/Grow as older equivalents) and explaining enum values in context (HUG/FILL/FIXED meanings). It clarifies that null clears bounds and relationships between properties, going beyond the schema's individual descriptions.

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 sets auto-layout sizing and child properties on a node. It distinguishes from sibling tool resize_nodes by recommending these properties over pixel-size guessing, and explicitly lists all properties it affects. The verb 'Set' plus resource 'node's auto-layout sizing and child properties' provides a specific and distinct purpose.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use guidance: layoutSizingHorizontal/Vertical are preferred over resize_nodes for sizing to content or filling parent. It explains preconditions (HUG needs an auto-layout frame or text; FILL needs an auto-layout parent) and contrasts older equivalents (layoutAlign, layoutGrow). This clearly informs an agent when to choose this tool over alternatives.

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