Skip to main content
Glama

mermaid_to_workflow

Convert Mermaid flowcharts into executable ComfyUI workflow JSON by parsing nodes, labeled connections, and widget values, then resolving types and filling defaults.

Instructions

Convert a Mermaid flowchart diagram back into a ComfyUI workflow JSON. Parses node definitions, connections (with data type labels), and widget values from the mermaid syntax. Resolves node types and wires connections using ComfyUI's /object_info schemas. Fills missing inputs with defaults. Returns a valid, executable ComfyUI API workflow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mermaidYesMermaid 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|).
Behavior4/5

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

Since no annotations are provided, the description carries full burden. It discloses that it resolves node types using /object_info schemas, wires connections, and fills missing inputs with defaults. This is thorough, though error handling on invalid Mermaid input is not mentioned.

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?

Three sentences, each adding value: first states purpose, second details parsing, third explains resolution and output. Front-loaded and no fluff.

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 single parameter and no output schema, the description covers the conversion process adequately, including how nodes and connections are resolved. It explains the necessary details for an agent to invoke the tool correctly.

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?

With 100% schema coverage, the description adds meaning beyond the schema by specifying that node labels should use ComfyUI class_type names and connections should be labeled with data types. It also clarifies that input can include or omit code fences.

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 clearly states that it converts a Mermaid flowchart into a ComfyUI workflow JSON, specifying parsing of node definitions, connections with data type labels, and widget values. It distinguishes itself from siblings like 'workflow_from_image' and 'dsl_to_workflow' by focusing on Mermaid syntax.

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

Usage Guidelines3/5

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

The description implies use when a Mermaid diagram is available, but does not explicitly state when to use this tool versus alternatives like 'dsl_to_workflow' or 'visualize_workflow'. No exclusion criteria or prerequisites are given.

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