Skip to main content
Glama

set_constraints

Control how a node responds when its parent frame is resized by applying horizontal and vertical constraints (MIN, MAX, CENTER, STRETCH, SCALE). Returns success and node ID.

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
Behavior3/5

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

Annotations indicate a mutation (readOnlyHint=false) and non-destructive (destructiveHint=false). The description details the behavior of each constraint but does not disclose whether constraints are additive or override existing settings, which would be useful.

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 two sentences: the first explains the tool and its options, the second provides constraints and return value. No unnecessary words, highly efficient.

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's simplicity (3 parameters, all required), the description covers usage, constraints, and return format. No output schema exists, but the simple return is adequately described.

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 100%, and the description adds meaningful context by explaining what each enum value (MIN, MAX, CENTER, STRETCH, SCALE) does, going beyond the enum names in the schema.

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 constraints on a node when its parent frame is resized, specifying the behavior for each enum value. It is distinct from sibling tools like set_auto_layout which deal with layout algorithms.

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 states that constraints only apply to plain frames, not auto-layout frames, providing clear guidance on when to use this tool. No explicit alternatives are mentioned, but the context is well-defined.

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