2 tools. Generated from the live MCP tool schemas — do not edit by hand; run
npm run docs:gen.get_workflow
Return, list, summarize or query a SAVED workflow FILE — files on disk, named from the library or given as a path/JSON — NOT the graph open on the user’s canvas (that is panel_graph_outline). Every action here is READ-ONLY; saving and locking are save_workflow. Driven by theaction parameter:
- action:“get” — the full JSON of one saved workflow FILE named from the library. Defaults to converted API format; pass format:‘ui’ for the raw on-disk UI JSON. Use action:“analyze” instead if you just need to UNDERSTAND the workflow — it returns a structured summary without flooding context with JSON. Use action:“get” only when you need the actual JSON for enqueue_workflow, create_workflow (action:“modify”), or save_workflow.
- action:“list” — the workflows saved in the connected ComfyUI server’s user library (the same ones visible in the ComfyUI web UI), INCLUDING the ones filed in subfolders. Requires a running ComfyUI server. Takes no other parameters. Returns a numbered list of library names, each relative to the library root — a workflow in a folder appears as ‘VIDEO/MiniMaxH3/clip.json’, and that whole string is what
filenametakes. It never reports an absence it did not establish: a listing it could not read says so, and an EMPTY listing says the library could not be CONFIRMED empty (an answer with no names in it cannot show whether it covered subfolders) and tells you to check the ComfyUI sidebar rather than recreate anything. - action:“strip” — strip a workflow to a clean, flat API graph, resolving Get/Set buses, Reroutes, subgraph definitions, and bypassed/muted nodes into real connections (the ‘de-getter-setter’ pass). Unlike action:“get” this reads from ANY server-side file path on disk (not just the workflow library), so it loads ad-hoc / expert workflow files that action:“list” and panel_open_workflow can’t resolve. Provide exactly one of: path, filename, or graph. Returns conversion warnings, a node-type summary, and the stripped graph (much smaller than the raw UI JSON).
- action:“slice” — slice ONE pipeline out of a toggle-template workflow, the kind built with rgthree ‘Fast Groups Bypasser/Muter’ where one graph holds many pipelines and only one is active at a time. Seeds from the output/SaveImage nodes in the named
groups, takes their backward dependency closure (through real links AND virtual Set/Get buses), un-bypasses the kept nodes (and the internals of any subgraph defs they use), and returns a STANDALONE, activated UI graph carrying only the subgraph defs it uses. Pair with action:“strip” afterward to flatten the Set/Get buses into real connections. - action:“from_image” — extract embedded ComfyUI workflow metadata from a PNG file. ComfyUI stores the full workflow (API format) and prompt data in PNG tEXt chunks. Use this to reverse-engineer how any ComfyUI image was generated.
- action:“analyze” — SUMMARIZE a saved workflow file named from the library: sections, node settings, connections, and data flow. Returns a concise text summary (not raw JSON) optimized for AI reasoning. Prefer this over action:“get” unless you need the raw JSON for enqueue_workflow or create_workflow (action:“modify”).
- action:“query” — filter, traverse, project, and aggregate over a saved workflow’s nodes WITHOUT dumping the whole JSON (the missing middle between action:“analyze“‘s fixed summary and action:“get“‘s full dump; on 100+-node graphs this is the ONLY context-safe way to answer questions like ‘which KSamplers run cfg>7’, ‘what feeds node 42’, ‘count nodes by type’). Provide exactly one of path/filename/graph, then combine:
types,title,wherewidget predicates ANDed (‘cfg>7’, ‘steps<=20’, ‘sampler_name=euler’, ‘text~sunset’ — ops = != >= <= > < ~contains),ids,upstream_of/downstream_of+depth,fields,group_by,limit,max_chars. Output is TOKEN-BOUNDED and, when it truncates, the tail names WHICH of the two caps fired and the exact parameter to raise — read it and retry rather than concluding the graph can’t be read. For the LIVE canvas this is panel_query_graph instead. - action:“prompt_director” — read Prompt Director’s latest sanitized RUNTIME state after its nodes execute: each node id, node kind, resolved Model Explorer model/LoRA context, structured edit plan, source analysis, exact final prompt, warnings, or Result Critic verdict. Secrets and image tensors are redacted. Pair it with a live panel graph audit: graph inspection explains wiring and widget state, while this explains what the nodes actually resolved and compiled. Pass
node_idto inspect one executed Prompt Director node.
Parameters
enum
required
Which read to perform. “list” and “prompt_director” take no required parameters; “get” and “analyze” require
filename; “strip”, “slice” and “query” require exactly one of path/filename/graph (and “slice” also requires groups); “from_image” requires image_path. Options: action:"get", action:"list", action:"strip", action:"slice", action:"from_image", action:"analyze", action:"query", action:"prompt_director".string
Workflow library name, exactly as action:“list” reports it. A workflow filed in a folder keeps its folder in the name (‘VIDEO/MiniMaxH3/clip.json’) and that whole string goes here. REQUIRED for action:“get” and action:“analyze”; one of the three sources for “strip”, “slice” and “query”.
enum
default:"api"
action:“get” — ‘api’ (default, recommended) converts to compact API format with named inputs, connection references, and _meta.mode flags for muted/bypassed nodes; ‘ui’ returns the raw UI format with layout positions and links arrays. action:“strip” — ‘api’ (default) strips to the flat resolved graph; ‘raw’ returns the file/graph unchanged. Each action accepts only its own two values (this field is the union of what the two tools it replaces accepted) and refuses the third rather than guessing at an alias. Options:
ui, api, raw.string
action:“strip” / “slice” / “query” — Absolute server-side path to a workflow .json on disk (e.g. C:\Users\you\ComfyUI\user\default\workflows\pusa_extend.json). Read directly from disk — no library lookup.
object
action:“strip” / “slice” / “query” — Inline workflow JSON (UI format for “strip”/“slice”; UI or API for “query”), as an alternative to path/filename.
string | string[]
action:“slice” (REQUIRED) — Group-title substrings (case-insensitive) whose output nodes seed the slice — CSV string or array, e.g. ‘TEXT TO IMAGE,TXT’ or [‘extend’,‘sampler’]. Shared post-proc is pulled in via the closure.
string
action:“from_image” (REQUIRED) — Absolute path to a ComfyUI-generated PNG file
enum
default:"summary"
action:“analyze” — summary (default): structured text with sections, node IDs, key settings, virtual wires, and full connection graph — best for AI understanding. overview: mermaid diagram showing sections as summary nodes with cross-section data flow. detail: mermaid diagram for one section (requires section parameter). list: text listing of all sections with data flow summary. flat: single mermaid flowchart of the entire workflow (best for small workflows). health: graph-health heuristics (disconnected nodes, duplicate model loads, orphaned branches, muted/bypassed). Options:
summary, overview, detail, list, flat, health.string
action:“analyze” — Section name for detail view. Use view=‘list’ first to see available section names.
string
action:“prompt_director” — Optional ComfyUI node id; omit to list all recent Prompt Director runtime states.
string[]
action:“query” — Keep nodes whose class_type contains ANY of these (case-insensitive).
string
action:“query” — Keep nodes whose title contains this.
string[]
action:“query” — Widget predicates, ANDed: ‘cfg>7’, ‘sampler_name=euler’, ‘text~sunset’.
string | number[]
action:“query” — Keep exactly these node ids.
string | number
action:“query” — Scope to the dependency closure FEEDING this node id.
string | number
action:“query” — Scope to the nodes CONSUMING this node id’s outputs.
integer
action:“query” — Max hops from the traversal seed (seed=0). Absent = full closure.
enum
action:“query” — Projection: compact one-liners (default), bare ids, or detail JSON rows. Options:
ids, compact, detail.enum
action:“query” — Aggregate: counts per class_type instead of listing. Options:
type.integer
action:“query” — Max nodes listed (default 40, max 200).
integer
action:“query” — Output character bound (default 12000, max 60000). Raise this — not
limit — when the truncation tail says the char budget cut the result.Examples
You say: What workflows have I got saved?filename.
You say: Open my portrait workflow so we can change the prompt.
save_workflow
WRITE to the ComfyUI user library: persist a workflow, or capture/verify its provenance lock. This is the only tool here that writes — reading is get_workflow. Driven by theaction parameter:
- action:“save” — Save a workflow JSON to the connected ComfyUI server’s user library so it appears in the ComfyUI web UI. Requires a running ComfyUI server; this writes to that server’s userdata and OVERWRITES any existing file with the same filename without confirmation. Web-UI-format JSON ({ nodes: [], links: [] }) is saved as-is and is the preferred input — when re-saving an existing workflow, load it with get_workflow (action:“get”, format=‘ui’) and modify THAT. API-format graphs ({ ‘1’: { class_type, inputs } }) are AUTO-CONVERTED to Web UI format with a generated layout so the saved file always opens in the ComfyUI canvas (the canvas cannot open raw API format). Returns a confirmation message (noting the conversion and any warnings), or the HTTP status and error text on failure.
- action:“lock” — Capture a provenance lock for a saved workflow so it can be exactly reproduced later. Walks the workflow’s model loaders (CheckpointLoaderSimple, UNETLoader, VAELoader, LoraLoader, ControlNetLoader, etc.), SHA-256s every referenced model file, records the git commit currently checked out for every custom node pack the workflow’s class_types come from, and captures ComfyUI’s reported version. WRITES
<filename>.lock.jsonnext to the workflow in ComfyUI’s user library. Requires a local install (COMFYUI_PATH) — SHA-256 needs raw file bytes and pack commits come fromcustom_nodes/*/.git/HEAD. Pair with action:“verify_lock” later to detect drift. - action:“verify_lock” — Compare a saved workflow’s lock file against the current state of the local install and report drift. Loads
<filename>.lock.json, re-computes a current lock from the same workflow, and diffs: which models have a different SHA-256, which custom node packs are on a different commit, whether ComfyUI’s version changed. Use before re-running an important workflow days or weeks later to confirm it’ll behave the same. Requires a local install (COMFYUI_PATH). Read-only; returns a structured drift report (empty arrays everywhere mean perfect parity).
Parameters
enum
required
Which write/provenance operation to perform. All three require
filename; “save” also requires workflow. Options: action:"save", action:"lock", action:"verify_lock".string
Workflow filename in the ComfyUI user library (e.g. ‘my_workflow.json’). REQUIRED for every action. For action:“save” this OVERWRITES an existing file of the same name; for “lock”/“verify_lock” the lock is read/written as ‘<filename>.lock.json’ alongside it.
object
action:“save” (REQUIRED) — Workflow JSON to save. Web UI format ({ nodes: [], links: [] }) is stored verbatim; API format ({ ‘1’: { class_type, inputs } }) is auto-converted to Web UI format (generated layout) so it stays openable in ComfyUI’s canvas. Not validated against the server before saving.
Examples
You say: Save that as a new file so I don’t lose the original.Shortened for readability — two nodes of a real API-format graph are shown. In practice the agent passes the whole thing: the graph it just loaded with get_workflow, or the one it built for you.