Skip to main content
Glama

edit_workflow

Apply a batch of edits to a ComfyUI workflow. Operations include adding, removing, connecting nodes, setting widget values, titles, and modes.

Instructions

Apply batched edits. Each op is a dict with 'op' plus:

  • {"op": "add_node", "class_type": str, "title"?: str, "widgets"?: {name: value}}

  • {"op": "remove_node", "node_id": int}

  • {"op": "connect", "from_node": int, "from_output": str|int, "to_node": int, "to_input": str}

  • {"op": "set_widget", "node_id": int, "input": str, "value": any}

  • {"op": "set_title", "node_id": int, "title": str}

  • {"op": "set_mode", "node_id": int, "mode": int} # 0 normal, 2 mute, 4 bypass

Output slot names and widget names come from get_node_info. Annotation nodes (class_type "Note" or "MarkdownNote") are supported with a single widget 'text'. Ops apply in order; a failing op stops the batch, reports what succeeded, and leaves the graph unchanged by the failing op.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationsYes
workflow_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

The description discloses important behavioral traits beyond annotations: ops apply in order, a failing op stops the batch and reports successes, leaving the graph unchanged by the failing op. It also references get_node_info for output and widget names and notes support for annotation nodes. This adds value beyond the annotations.

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 clear lead sentence and a bulleted list of operations. It is efficient but could be slightly more concise by grouping common fields. No unnecessary words.

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?

Given the complexity and the presence of an output schema (not shown), the description covers input parameters thoroughly, includes failure behavior, and references related tools. It is complete for the tool's purpose, though it could mention whether edits are saved automatically.

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?

The input schema has 0% coverage for descriptions, but the description compensates by detailing each op structure with fields like 'op', 'class_type', 'node_id', etc. This adds significant meaning. However, the 'workflow_id' parameter is not described at all, leaving it implicit.

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?

The description states 'Apply batched edits' and lists specific operations (add_node, remove_node, etc.), making it clear that the tool edits a workflow. However, it does not explicitly state the resource is a workflow, and it doesn't differentiate from sibling tools like organize_workflow.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention scenarios where batched edits are preferred or any prerequisites. The agent must infer usage from the operation list.

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/EnragedAntelope/comfy-draftsman'

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