Skip to main content
Glama

set_constraints

Define how a node reacts to parent frame resizing by setting horizontal and vertical constraints: MIN, MAX, CENTER, STRETCH, or SCALE. Works only on plain frames, not auto-layout.

Instructions

Set how a node responds when its parent frame is resized, via horizontal and vertical constraints: MIN pins to the left/top, MAX to the right/bottom, CENTER keeps it centered, STRETCH pins both edges (grows with the parent), and SCALE resizes proportionally. Constraints apply inside plain frames only — auto-layout frames position children by layout rules and ignore them. Returns { ok, nodeId }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nodeIdYesNode to constrain
verticalYesVertical behavior when the parent resizes
horizontalYesHorizontal behavior when the parent resizes
Behavior4/5

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

Annotations already indicate this is a non-readonly, non-destructive operation. The description adds valuable behavioral context by explaining what each constraint mode does and the limitation that auto-layout frames ignore these constraints, without contradicting annotations.

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?

The description is three sentences, front-loaded with the primary purpose, followed by enum explanations, a critical caveat, and the return value. Every sentence earns its place with no redundancy.

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?

Without an output schema, the description explicitly provides the return shape { ok, nodeId }. It covers all three parameters, explains the enum values, and discloses the auto-layout limitation. This is more than sufficient for an agent to use the tool correctly.

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

Parameters5/5

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

While the schema describes the parameters, the description enriches the enum values with concrete spatial semantics (MIN pins left/top, MAX right/bottom, CENTER centers, STRETCH grows, SCALE proportional). This is essential for correct parameter selection and goes well beyond the schema's minimal 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 it sets constraints on a node's response to parent frame resizing, with a specific verb and resource. It distinguishes itself from sibling tools by focusing on constraints and enumerating the available modes with concrete meanings.

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

Usage Guidelines4/5

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

It explicitly notes that constraints only apply inside plain frames and are ignored in auto-layout frames, which is a key when-not usage signal. However, it doesn't explicitly name alternative tools (e.g., set_auto_layout), so it stops short of full alternative guidance.

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