Skip to main content
Glama

pack_workspace_subgraph

Convert selected nodes or groups into a subgraph, or unpack a subgraph to restore its contents. Preserves existing wiring while organizing the workflow.

Instructions

Wrap nodes and groups into a new subgraph, or dissolve one back out.

ComfyUI's "Convert to Subgraph" and its Unpack counterpart. Folding a stage into a subgraph is how a workflow stops being a wall of nodes: the box keeps its own wiring, and promote_workspace_inputs decides which of its values show on the outside.

It acts on the graph on screen, so packing while inside a subgraph nests one. Ids are the plain local ones a read of that graph reports, not the 98:12 path form - a selection only ever belongs to one graph. Use navigate_workspace first when the nodes are a level down.

A group can be named instead of listing its nodes: it goes in along with everything inside it, which is what selecting one on the canvas amounts to.

One call is one Ctrl+Z, and unpacking happens before packing - so a single call can dissolve a subgraph and re-wrap its parts differently.

Ids do not survive either direction. Packing replaces the nodes with one new node; unpacking hands the contents fresh ids rather than the ones they went in with - measured, 144 and 145 came back out as 158 and 159. Read the graph again afterwards rather than reusing ids from before.

This is not the same as moving a node into a subgraph that already exists. ComfyUI has no operation for that; unpack the subgraph, then pack the parts together with whatever else belongs there.

Args: pack: node and group ids to fold into one new subgraph. Anything that is not one convertible block is refused by litegraph, which says nothing else, so the refusal names that. unpack: subgraph node ids to dissolve, putting their contents back into the graph on screen. A node that is not a subgraph is refused. client_id: which browser tab to act in; defaults to the most recently focused one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packNo
unpackNo
client_idNo

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 to rely on, this description carries the full burden of behavioral disclosure—and excels. It states the tool 'acts on the graph on screen' and that IDs do not survive in either direction, complete with concrete before/after examples (144/145 reused as 158/159). It also reveals the call order semantics (unpack before packing) and how invalid inputs are 'refused by litegraph', demonstrating deep transparency.

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?

Though lengthy, the description earns its length: it's organized into short, scannable paragraphs with a clear logical flow (purpose → scoping → parameter nuances → caveats). The Args section is neatly formatted. Every sentence adds informative value, and the structure supports quick comprehension for an AI agent.

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?

For a tool with no annotations and a generic schema, the description is remarkably complete. It covers edge cases (nested subgraphs, ID invalidation), specifies preconditions (call navigate_workspace first), details interactions with undo, and explicitly contrasts with a sibling operation that does not exist. No obvious gaps remain for an agent to misuse the tool.

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?

The schema provides zero parameter descriptions, so the tool's Args section becomes critical. It explains that 'pack' expects node/group IDs and mentions what gets refused, 'unpack' identifies subgraph nodes to dissolve, and 'client_id' determines the target browser tab. This adds essential semantics beyond the bare union types 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 opens with a precise verb-resource pairing: 'Wrap nodes and groups into a new subgraph, or dissolve one back out.' It immediately distinguishes the dual packing/unpacking behavior and grounds it in ComfyUI's 'Convert to Subgraph' and 'Unpack' concepts, making the tool's purpose unmistakable even to an agent familiar with the UI.

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?

Explicit usage guidance is woven throughout: 'Use navigate_workspace first when the nodes are a level down' and 'This is not the same as moving a node into a subgraph that already exists...' The description clarifies when to use this tool over alternatives and even explains the workaround for a missing operate-on-existing-subgraph feature. It also sets expectations with 'One call is one Ctrl+Z'.

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