Skip to main content
Glama

align_workspace

Align selected ComfyUI nodes along any edge or distribute them evenly without moving others, fixing untidy graphs while preserving layout.

Instructions

Line nodes up on a common edge, space them evenly, or both.

Unlike arrange_workspace this never reads a link: it moves the nodes it is given along one axis and changes nothing else about the layout. That is the point - straightening a row of loaders should not rearrange the workflow around them. Reach for this when the graph is already laid out the way the author wants and only looks untidy.

Edges account for how big each node draws, so aligning right lines up the far edges of nodes of different widths rather than their positions, and a collapsed node lines up by its title bar rather than by the size it reports.

Args: nodes: the node ids to align - at least two. From get_workspace_graph. edge: "left", "right", "top", "bottom", "centre_x" or "centre_y". The centre forms use the middle of the whole selection. distribute: "x" or "y" - even out the gaps between the nodes along that axis. The outermost two stay where they are and the rest are shared out between them; gaps rather than centres, since nodes differ in size enough that even centres look uneven. spacing: an exact gap for distribute, in canvas units, instead of filling the space the nodes already span. edge and distribute combine only across axes: aligning tops while spreading horizontally is one intention, aligning lefts while spreading horizontally is two contradictory ones. apply: write the positions. False reports them without touching the canvas; the same dict can be passed to set_workspace_layout. scope: "root" for the whole workflow, "active" for the subgraph on screen. client_id: which tab to edit; defaults to the most recently focused one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
edgeNo
applyNo
nodesYes
scopeNoroot
spacingNo
client_idNo
distributeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations, the description fully discloses behavior: it moves nodes along one axis only, accounts for node draw sizes including collapsed nodes, explains the effect of apply=false, and warns about contradictory edge/distribute combinations. This goes far beyond basic operation.

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 front-loaded with the main purpose, then uses concise paragraphs for distinction, edge cases, and parameter details. Every sentence earns its place, and the structure flows logically from use-case to parameter explanations.

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 output schema exists, return values need no explanation. The description covers all parameters, usage scenarios, edge cases, and even interactions between parameters. It is complete for a complex tool with 7 parameters.

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?

Despite 0% schema description coverage, the Args section documents all seven parameters with meaningful details (e.g., 'centre forms use the middle of the whole selection', 'spacing: an exact gap for distribute'). This compensates completely for the schema's lack of 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 starts with a specific verb and resource: 'Line nodes up on a common edge, space them evenly, or both.' It explicitly contrasts with sibling tool arrange_workspace, stating 'Unlike arrange_workspace this never reads a link...' This clearly distinguishes the tool's purpose and scope.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use guidance: 'Reach for this when the graph is already laid out the way the author wants and only looks untidy.' It also names the alternative tool (arrange_workspace) and explains the difference, making the choice context clear.

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/pytraveler/local-comfyui-mcp'

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