Skip to main content
Glama

align_to_grid

Snap Figma nodes' parent-relative x/y positions to a fixed grid, and optionally round width and height to grid units, returning before/after values per node to verify alignment changes.

Instructions

Snap nodes' x/y (relative to their parent) to a grid of gridSize px; with snapSize also round width/height to the grid. Returns before/after per node.

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>",
      "gridSize": "<gridSize>"
    },
    "name": "align_to_grid"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoTarget file (fileKey, id or name). Defaults to the most recently active file.
nodeIdsYes
gridSizeYes
snapSizeNoAlso snap width/height (min one grid unit)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations at all, the description must carry the behavioral load, and it does disclose the coordinate frame (parent-relative) and the return shape (before/after per node), which are the two least obvious traits. It does not say whether the change is immediately persisted, whether it can be undone, or what happens on invalid or missing nodes, which matters for an unannotated mutation tool.

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?

A single tightly written sentence with the core action and coordinate scope front-loaded, followed by the conditional mode and the return value. No filler, and each clause adds distinct information.

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-parameter mutation tool with 50% schema coverage and no output schema, the description covers the action, the coordinate frame, the optional branch, and the return payload. Only persistence/undo and per-parameter detail for nodeIds remain unaddressed, which is a small residual gap.

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 50% (only file and snapSize are documented inline), and the description compensates by defining gridSize as a pixel grid and clarifying that snapSize is what extends snapping to width/height, which is more than the schema says. nodeIds is still only implied (the nodes whose x/y get snapped) rather than explicitly described, so it falls short of full coverage.

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?

States a specific verb and resource: snap nodes' x/y, relative to their parent, onto a gridSize px grid, with an optional size-snapping mode. That is more precise than the name alone and is distinguishable from positioning siblings like distribute_nodes, but it never names align_nodes or arrange_grid as the alternatives, so the differentiation is inferred rather than stated.

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?

The description implies the use case (normalizing node positions and optionally sizes to a grid) and says the coordinates are parent-relative, which is a useful precondition. It gives no explicit when-to-use versus when-not guidance, no statement of what happens to already-aligned nodes, and no pointer to align_nodes or arrange_grid for aligning to other targets.

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