Skip to main content
Glama

set_constraints

Set horizontal and vertical resize constraints on Figma nodes to control responsive resizing; choose MIN, MAX, CENTER, STRETCH, or SCALE per axis, and unspecified axes stay unchanged.

Instructions

Set resize constraints on nodes. Pass horizontal and/or vertical (MIN|MAX|CENTER|STRETCH|SCALE); the unspecified axis is kept. Auto-layout children that aren't absolutely positioned return an error. Returns previous and new values.

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_constraints"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoTarget file (fileKey, id or name). Defaults to the most recently active file.
nodeIdsYes
verticalNo
horizontalNo

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 reasonably well: it discloses the failure mode (auto-layout children that aren't absolutely positioned), partial-update behavior (unspecified axis kept), and the return payload (previous and new values). It omits permission/auth requirements and whether multi-node updates are atomic.

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?

Three tight sentences: purpose first, then parameter rules, then error and return behavior. No filler, and the most decision-relevant constraint is up front.

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?

For a 4-param mutation tool with no annotations and no output schema, the description covers the essentials: what changes, partial-update semantics, failure condition, and what is returned. The remaining gap is nodeIds handling and per-node error behavior on batched calls.

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 only 25% (only 'file' is documented), so the description must compensate, and it explains that horizontal and vertical are optional and independently settable, plus that omitting one preserves the existing value. nodeIds semantics (plural, batched) are only indirectly conveyed by 'nodes'.

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?

Specific verb+resource: 'Set resize constraints on nodes'. It clearly differs from layout siblings like set_layout_child or set_auto_layout by the error clause about auto-layout children, though it never names an alternative outright.

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?

Usage is implied through the axis rules and the auto-layout restriction, which effectively tells the agent when the call will fail. It never states when to prefer this over set_layout_child or other layout tools, so no real alternative routing is given.

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