Skip to main content
Glama

set_workspace_layout

Set node layout on the ComfyUI canvas by specifying positions, sizes, and fold states, automatically refitting groups around moved nodes.

Instructions

Move, resize, fold and unfold nodes on the canvas open in the browser.

None of this changes what a workflow does - it runs the same however it is laid out - so this is purely about making a graph readable. The whole batch is one undo step and nothing is written unless every id exists.

Groups follow the nodes they were holding. A group is only a rectangle, and what is "inside" it is whatever falls within it, so moving nodes out from under one would silently empty it; membership is read before anything moves and each affected group is refitted around those same nodes afterwards.

arrange_workspace computes positions rather than taking them, and its answer can be passed straight in here.

Args: positions: {"<node_id>": [x, y]}. Canvas coordinates, y downwards. A pinned node is skipped rather than moved, and reported in skipped - pinning is the author saying "not this one". sizes: {"<node_id>": [width, height]}. A size below what the node needs to draw its widgets is raised to that minimum and reported. collapsed: {"<node_id>": true} to fold a node down to its title bar, false to unfold it. The desired state, not a toggle, so asking for what a node already is does nothing. get_workspace_graph reports the current state per node. refit_groups: refit every group that held one of the changed nodes. Turning this off leaves the boxes where they were, which is what you want when moving a node deliberately out of a group. 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
scopeNoroot
sizesNo
client_idNo
collapsedNo
positionsNo
refit_groupsNo

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 carries full responsibility and excels. It discloses atomicity ('The whole batch is one undo step and nothing is written unless every id exists'), group behavior ('membership is read before anything moves and each affected group is refitted around those same nodes afterwards'), pinning behavior ('A pinned node is skipped rather than moved, and reported in `skipped`'), and idempotent collapsed semantics ('asking for what a node already is does nothing'). These are non-obvious traits that would affect invocation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is longer than average but front-loaded with the core purpose and caveat that workflow behavior is unchanged. The Args section is dense but each sentence adds value – no fluff. It could be slightly tightened, but the complexity of group behavior and multiple parameters justifies the length.

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?

The description covers all six parameters, explains edge cases (pinning, minimum sizes, empty groups), describes side effects (undo step, atomic validation), and references related tools (arrange_workspace, get_workspace_graph). With an output schema present, the lack of return-value detail is acceptable. The tool is fully contextualized for an agent.

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?

Schema description coverage is 0%, so the description must fully compensate. It explains every parameter in detail: positions with coordinates and pinning, sizes with minimum raising, collapsed as desired state not toggle, refit_groups with rationale, scope values, and client_id default. This goes beyond simple type information to provide actionable semantics.

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 opens with a specific verb+resource: 'Move, resize, fold and unfold nodes on the canvas open in the browser.' This clearly distinguishes it from siblings by listing concrete operations and later references arrange_workspace for computed positions, making the tool's unique role obvious.

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 states when to use it: 'purely about making a graph readable' (layout vs workflow semantics) and explicitly names an alternative: 'arrange_workspace computes positions rather than taking them, and its answer can be passed straight in here.' It also mentions get_workspace_graph for reading current collapsed state, offering clear contextual 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/pytraveler/local-comfyui-mcp'

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