Skip to main content
Glama

set_constraint

Define and apply horizontal and vertical layout constraints (left, right, top, bottom, center, scale, stretch) to Figma nodes. Supports batch operations, child nodes, and aspect ratio preservation for precise design control.

Instructions

Set constraints (left/right/top/bottom/center/scale/stretch) for one or more Figma nodes.

Returns: Array of result objects for each operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
applyToChildrenNoIf true, apply constraints to all children of the node(s).
constraintNoA single constraint entry to apply.
constraintsNoAn array of constraint entries to apply in batch.
maintainAspectRatioNoIf true, maintain the aspect ratio when applying constraints.
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the mutation action ('Set') and return format ('Array of result objects'), but lacks critical details: whether this operation is destructive to existing constraints, permission requirements, error conditions, or how batch operations handle failures. For a mutation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 appropriately brief (two sentences) and front-loaded with the core purpose. The second sentence about return values is useful but could be integrated more smoothly. No wasted words, though slightly choppy structure.

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?

For a mutation tool with no annotations and no output schema, the description provides basic purpose and return format but lacks sufficient behavioral context. It doesn't explain what 'constraints' mean in Figma's layout system, potential side effects, or error handling. Given the complexity (4 parameters including nested objects), this is minimally adequate but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 4 parameters and their purposes. The description adds no parameter-specific information beyond what's in the schema (e.g., it doesn't explain constraint combinations or the relationship between 'constraint' and 'constraints' parameters). Baseline 3 is appropriate when schema does the heavy lifting.

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 specific action ('Set constraints'), the target resource ('Figma nodes'), and enumerates the constraint types ('left/right/top/bottom/center/scale/stretch'). It distinguishes itself from sibling tools like 'get_constraint' (which retrieves constraints) and 'set_auto_layout' (which sets different layout properties).

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing node IDs), exclusions (e.g., not applicable to certain node types), or compare it to related tools like 'set_auto_layout' or 'resize_node' that might affect node positioning. Usage context is implied but not explicit.

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

Related 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/amalinakurniasari/conduit'

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