Skip to main content
Glama

add_workspace_node

Add a node to the ComfyUI canvas with specified type, values, and connections, all validated before applying as a single undoable edit.

Instructions

Add a node to the workflow open in the browser, wired up and configured.

Inserting a node is one edit, so it is one call and one Ctrl+Z: the widgets and links go in with it. Doing it in three calls would take three presses to undo one intention, and a failure partway would leave a stray node behind.

Nothing is added unless every value and link validates. Link types are checked against the slots before anything is written, because litegraph refuses a mismatched connection by doing nothing and reporting nothing.

Args: type: the registered node type, e.g. "ImageScale" or "VAEEncodeTiled". find_node_types looks one up, by slot type when the name is not known; an unknown one comes back with near matches rather than a bare refusal. title: the label on the node. Defaults to the type's own. pos: [x, y] on the canvas. Defaults to the middle of the current view, so the user can see what arrived. values: widget values for the new node, {"<widget>": value} - no node id, since it does not have one yet. connect: links to make at the same time, [{"from": ..., "to": ...}] with both ends written "<node_id>.<slot>". The new node is "this", as in {"from": "this.IMAGE", "to": "9.images"}. A slot can be named or given by index. 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
posNo
typeYes
scopeNoroot
titleNo
valuesNo
connectNo
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 provided, the description carries the full burden. It discloses atomicity (one edit, one Ctrl+Z), all-or-nothing validation ('Nothing is added unless every value and link validates'), link type checking with litegraph's silent failure, and defaults for pos, title, and client_id. This goes well beyond a simple 'adds a node' statement.

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 well-structured with a purpose statement, rationale, validation note, and parameter breakdown. It is slightly verbose with the explanation of the one-call undo advantage, but that content is relevant and not wasteful. Overall, it is appropriately sized for the tool's complexity.

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 complexity (7 parameters, connect syntax, error behavior), the description is complete. It covers all parameters, defaults, validation, and failure modes. The output schema exists, so not detailing return values is acceptable. The context of the workflow editor and user experience (e.g., default pos to current view) is also addressed.

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 Args section explains every parameter in detail, providing examples, defaults, and syntax. For instance, 'connect' is illustrated with `{"from": "this.IMAGE", "to": "9.images"}` and the meaning of 'scope' is defined. Since schema description coverage is 0%, this description fully compensates and adds significant value.

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 begins with a clear, specific statement: 'Add a node to the workflow open in the browser, wired up and configured.' This distinguishes the tool from siblings like set_workspace_links or set_workspace_values, as it covers the full addition with wiring and configuration in one operation.

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?

The description explicitly advises doing the addition in one call to get a single Ctrl+Z undo and avoid stray nodes from partial failures. It contrasts this with splitting the work into three calls, thus giving clear context for when to use this tool over a combination of separate operations. It does not mention alternative tool names explicitly, but the guidance is clear enough.

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