Skip to main content
Glama

comfy_import_workflow_from_png

Read-onlyIdempotent

Extract a ComfyUI workflow from a PNG's tEXt metadata. Returns the API-format prompt when available, otherwise the UI-format workflow, along with the source file path.

Instructions

Extract a workflow from a ComfyUI-saved PNG's tEXt metadata.

ComfyUI embeds the workflow JSON in the PNG on save:

  • 'prompt' chunk: API format (directly queueable)

  • 'workflow' chunk: UI format (with positions, widgets)

This tool prefers 'prompt' and falls back to 'workflow'. Returns {format: 'api' | 'ui' | 'none', workflow: dict, path: str}.

Args: png_path: Absolute path to the PNG file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
png_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds valuable behavioral context: it prefers 'prompt' and falls back to 'workflow', and it specifies the return format. This goes beyond annotations and helps the agent understand the extraction logic without contradiction.

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 concise and well-structured with a clear purpose sentence, bullet points for metadata chunks, and a return format note. No unnecessary fluff; each sentence adds value. It could be slightly tightened by omitting the explicit return format since output schema exists, but it's not detrimental.

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?

For a tool with one parameter and an output schema, the description is complete: it covers the extraction mechanism, the two formats, fallback behavior, and the return structure. The output schema provides additional detail, so the description is fully adequate for this straightforward tool.

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 only parameter is png_path, and the schema simply says it's a string titled 'Png Path'. The description clarifies it must be an 'Absolute path to the PNG file', which is a meaningful addition beyond the schema. Though minimal, it's sufficient for a single-parameter tool.

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 'Extract a workflow from a ComfyUI-saved PNG's tEXt metadata' — a specific verb and resource. It distinguishes from siblings like comfy_import_workflow and comfy_export_workflow, and the fallback behavior between prompt and workflow formats adds precision.

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

Usage Guidelines4/5

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

The description implicitly specifies when to use this tool (when you have a PNG with embedded workflow) and explains the metadata chunks. It does not explicitly mention alternative tools, but the scope is clear and the fallback logic informs the user's expectations. No explicit exclusions, but sufficient 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/dreamrec/ComfyPilot'

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