Skip to main content
Glama

visualize_workflow

Convert ComfyUI workflow JSON into Mermaid diagrams or compact DSL text, and convert back into executable JSON. Use it to inspect, document, and rebuild pipelines from API-format graphs.

Instructions

DRAW a diagram of, or convert, workflow JSON you PASS IN (a JSON string or object) — it does NOT read the user's live canvas, so for 'show me what's on the canvas' / the CURRENTLY-OPEN graph use panel_graph_outline instead. Driven by the action parameter:

  • action:"render" — Mermaid flowchart of the whole graph: nodes grouped by category, connections labeled by data type.

  • action:"render_hierarchical" — the same graph SECTIONED rather than flat, which is what you want past ~20 nodes. view picks a compact overview, one section in detail, a text listing, or an AI-oriented structured summary.

  • action:"mermaid" — the INVERSE of render: a Mermaid flowchart back into executable API-format workflow JSON, wired from /object_info schemas.

  • action:"to_dsl" — API-format JSON into the compact, human/LLM-readable authoring DSL: key <- nodeId.outputIndex for connections, key = <JSON> for literals. Round-trips losslessly. (Experimental.)

  • action:"from_dsl" — that DSL back into executable JSON, plus advisory wiring warnings when ComfyUI is reachable (the conversion succeeds either way). (Experimental.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dslNoaction:"from_dsl" (REQUIRED) — Workflow DSL text
viewNoaction:"render_hierarchical" — overview: compact diagram with sections as summary nodes; detail: full diagram for one section; list: text summary of all sections; summary: structured text optimized for AI ingestion with node IDs, key settings, virtual wires, and full connection graphoverview
actionYesWhich rendering/conversion to perform. "render", "render_hierarchical" and "to_dsl" require `workflow`; "mermaid" requires `mermaid`; "from_dsl" requires `dsl`.
mermaidNoaction:"mermaid" (REQUIRED) — Mermaid flowchart text (with or without ```mermaid code fence). Nodes should use ComfyUI class_type names as labels. Connections should be labeled with data types (e.g., -->|MODEL|).
sectionNoaction:"render_hierarchical" — Section name to show in detail view (required when view=detail). Use view=list to see available section names.
workflowNoComfyUI workflow JSON (as a JSON string or object; API or UI format is auto-detected). REQUIRED for action:"render", action:"render_hierarchical" and action:"to_dsl" — "to_dsl" expects API format (node ID -> {class_type, inputs}).
directionNoaction:"render" / action:"render_hierarchical" — Flowchart direction: LR (left-to-right) or TB (top-to-bottom). Default LR for "render" and for the hierarchical detail view, TB for the hierarchical overview.
show_valuesNoaction:"render" / action:"render_hierarchical" — Include widget values (seed, steps, cfg, etc.) in node labels (detail view only, for the hierarchical action).
Behavior4/5

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

With no annotations provided, the description carries the full transparency burden. It discloses that the tool does not read the live canvas, that conversions round-trip losslessly, that from_dsl emits advisory warnings only when ComfyUI is reachable, and marks experimental actions. It doesn't explicitly state side-effect safety (e.g., read-only), but the nature of the actions and these caveats offer good behavioral insight.

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?

The description is long but extremely well-structured, front-loading the core purpose and the key limitation before a bullet list of actions. Each action is described in one compact sentence with prerequisites and output types. No filler or repetition; all sentences earn their place.

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 8 parameters, 5 actions, no annotations, and no output schema, the description compensates thoroughly. It covers every action's purpose, requirements, and output format, plus edge cases like auto-detection of API/UI format and lossless round-tripping. The absence of an output schema is mitigated by explicit descriptions of each action's result (diagram, text listing, structured summary, DSL).

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?

Schema coverage is 100% and each parameter already has a detailed description. The tool description adds value by tying parameters to actions, e.g., 'to_dsl expects API format (node ID -> {class_type, inputs})' and clarifying which action requires which parameter. This goes beyond the schema's per-field descriptions, providing cross-parameter 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: 'DRAW a diagram of, or convert, workflow JSON you PASS IN.' It immediately distinguishes from siblings by noting it does NOT read the live canvas and directs to panel_graph_outline for that case. The action list further clarifies each mode (render, render_hierarchical, mermaid, to_dsl, from_dsl), making the tool's purpose unmistakable.

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 explicitly states when to use an alternative: for 'show me what's on the canvas' use panel_graph_outline. It also gives action-specific guidance, e.g., render_hierarchical is what you want past ~20 nodes, and to_dsl/from_dsl are experimental. This provides clear when-to-use and when-not-to-use context.

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/artokun/comfyui-mcp'

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