Skip to main content
Glama

comfyui_analyze_workflow

Read-onlyIdempotent

Analyze a ComfyUI workflow to get structured data: node count, class types, flow, models, parameters, pipeline type, and prompt/negative nodes. Returns a JSON dict for direct access.

Instructions

Analyze a ComfyUI workflow and return its structured shape.

    Unlike ``comfyui_summarize_workflow`` (which formats a human-readable
    text or Mermaid summary), this tool returns the raw analysis as a dict
    so callers can read individual fields directly without parsing prose.

    Args:
        workflow (required): JSON string of the workflow to analyze. The
            workflow JSON is a dict keyed by node ID; each value has
            ``class_type`` and ``inputs``.

    Returns:
        Dict with keys:

        - ``node_count`` (int): number of nodes in the workflow.
        - ``class_types`` (list[str]): every ``class_type`` in topological
          order.
        - ``flow`` (list[dict]): per-node info — ``node_id``, ``class_type``,
          ``display_name``, ``inputs`` — in topological order.
        - ``models`` (list[dict]): single-field loader values, e.g.
          ``[{"name": "v1-5-pruned.safetensors", "type": "checkpoints"}]``.
        - ``parameters`` (dict): flat key/value of common sampler/latent
          parameters extracted from the graph (``steps``, ``cfg``, ``width``,
          ``height``, etc.).
        - ``pipeline`` (str): coarse type — one of ``txt2img``,
          ``img2img``, ``upscale``, ``img2img -> upscale``,
          ``txt2img -> upscale``, or ``unknown``.
        - ``prompt_nodes`` (list[str]): ids of ``CLIPTextEncode`` nodes
          that are NOT wired into any sampler's ``negative`` input
          (the analyzer treats every non-negative CLIPTextEncode as
          a positive prompt — it does not separately verify that it
          is wired into a sampler's positive input).
        - ``negative_nodes`` (list[str]): ids of ``CLIPTextEncode`` nodes
          wired into a sampler's ``negative`` input.

    Display-name enrichment is best-effort via ComfyUI's ``/object_info``
    endpoint; if the server is unreachable, ``display_name`` falls back to
    the bare ``class_type``.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Annotations already mark it as read-only and idempotent, and the description adds substantial context: raw dict return shape, best-effort display-name enrichment via /object_info with a documented fallback, and the prompt_nodes detection limitation. This goes well beyond the annotation baseline.

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?

Structured with clear Description/Args/Returns sections and bullet-list return keys. Although lengthy, every sentence contributes distinct, useful information and the formatting keeps it scannable.

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?

Despite having an output schema, the description still documents every return key with types and examples, plus graceful fallback behavior. For a single-parameter read-only tool, this is fully complete.

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 schema description coverage at 0%, the description fully compensates by explaining that workflow is a JSON string keyed by node ID with class_type and inputs. This gives the agent the exact format needed, which the schema alone does not.

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?

States 'Analyze a ComfyUI workflow and return its structured shape' — a specific verb plus resource. It also distinguishes itself from comfyui_summarize_workflow, making the tool's unique role immediately clear.

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?

Explicitly instructs to use this tool instead of comfyui_summarize_workflow when a raw dict is needed without parsing prose. This provides a clear alternative and a concrete when-to-use criterion.

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/hybridindie/comfyui_mcp'

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