Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MCP_DEBUGNoEnable debug logging
MCP_LOG_LEVELNoSet log level (DEBUG, INFO, WARNING, ERROR)
COMFYUI_SERVERNoComfyUI server address127.0.0.1:8188

Tools

Functions exposed to the LLM to take actions

NameDescription
read_workflow

Read a workflow file and return it as DSL format.

Supports both JSON and DSL input files. Automatically detects format and converts JSON to DSL transparently.

Args: filepath: Path to workflow file (.json or .dsl)

Returns: Workflow content in DSL format

Examples: read_workflow("workflows/my_workflow.json") read_workflow("../dsl/examples/dsl/simple.dsl")

write_workflow

Write a workflow to disk.

Takes DSL content and writes it to disk. By default, converts to JSON format. Can optionally save as .dsl format directly.

Args: filepath: Destination file path dsl: Workflow content in DSL format format: Output format ("json" or "dsl", default: "json")

Returns: Status dict with path, size, and format info

Examples: write_workflow("workflows/new_workflow.json", dsl_content) write_workflow("workflows/backup.dsl", dsl_content, format="dsl")

list_workflows

List workflow files in a directory.

Discovers workflow files (.json and .dsl) in the specified directory. Supports glob patterns for filtering.

Args: directory: Directory to search (default: "workflows") pattern: Glob pattern for filtering (default: "*" for all files)

Returns: List of workflow info dicts with name, size, modified time

Examples: list_workflows() list_workflows("workflows", "*.json") list_workflows("../dsl/examples/dsl")

validate_workflow

Validate DSL workflow syntax.

Parses DSL and checks for syntax errors without executing the workflow. Returns validation status and any errors found.

Args: dsl: Workflow content in DSL format

Returns: Validation result with is_valid, errors, and warnings

Examples: validate_workflow(dsl_content)

get_workflow_info

Analyze workflow structure and return metadata.

Parses DSL and extracts structural information like node types, sections, and connections without executing the workflow.

Args: dsl: Workflow content in DSL format

Returns: Workflow metadata including nodes, sections, and connections

Examples: get_workflow_info(dsl_content)

list_templates

List available workflow templates.

Discover workflow templates by category, difficulty, or tags. Templates provide ready-to-use workflows for common use cases.

Args: category: Filter by category (Generation, Enhancement, Editing, etc.) difficulty: Filter by difficulty (beginner, intermediate, advanced) tag: Filter by tag (text2img, inpainting, controlnet, etc.)

Returns: List of template metadata with names, descriptions, and parameters

Examples: list_templates() list_templates(category="Generation") list_templates(difficulty="beginner") list_templates(tag="text2img")

get_template

Get detailed information about a specific template.

Retrieves complete template information including parameters, requirements, and DSL preview.

Args: template_name: Name of the template to retrieve

Returns: Template details with parameters and DSL preview

Examples: get_template("text2img_basic") get_template("controlnet_pose")

generate_from_template

Generate a workflow from a template with custom parameters.

Creates a complete DSL workflow by substituting parameters into the template. Optionally saves to file.

Args: template_name: Name of the template to use parameters: Dictionary of parameter values to substitute save_path: Optional path to save the generated workflow

Returns: Generated DSL content and validation results

Examples: generate_from_template("text2img_basic", {"prompt": "sunset"}) generate_from_template("img2img", {"image_path": "input.png"}, "workflows/my_img2img.dsl")

search_templates

Search templates by name, description, or tags.

Performs fuzzy search across template metadata to find relevant workflow templates.

Args: query: Search query (searches name, description, tags)

Returns: List of matching templates

Examples: search_templates("pose") search_templates("upscaling") search_templates("text to image")

validate_template_parameters

Validate parameters for a template without generating.

Checks if provided parameters are valid for the template and returns detailed validation results.

Args: template_name: Name of the template parameters: Dictionary of parameters to validate

Returns: Validation results with errors and warnings

Examples: validate_template_parameters("text2img_basic", {"width": "512"})

sync_official_templates

Sync official ComfyUI templates from GitHub.

Downloads and processes official workflow templates from the Comfy-Org/workflow_templates repository. Converts them to DSL format for use with the template system.

Returns: Sync status with count of successfully processed templates

Examples: sync_official_templates()

list_official_templates

List official ComfyUI templates.

Returns templates from the official Comfy-Org repository that have been synced and converted to DSL format.

Returns: List of official template metadata

Examples: list_official_templates()

get_template_dsl

Get DSL content for any template (custom or official).

Retrieves the DSL representation of a template, which can then be modified or executed directly.

Args: template_name: Name of the template source: Template source ("custom", "official", or "auto")

Returns: Template DSL content and metadata

Examples: get_template_dsl("text2img_basic") get_template_dsl("openai_dalle_3_text_to_image", "official")

execute_workflow

Execute a DSL workflow on ComfyUI server.

Converts DSL to JSON and submits to ComfyUI for execution. Can optionally wait for completion and return results.

Args: dsl: Workflow content in DSL format server_address: ComfyUI server address (default: 127.0.0.1:8188) wait_for_completion: Whether to wait for execution to complete timeout_seconds: Maximum time to wait for completion

Returns: Execution result with prompt_id, status, and outputs if completed

Examples: execute_workflow(dsl_content) execute_workflow(dsl_content, server_address="192.168.1.100:8188") execute_workflow(dsl_content, wait_for_completion=False)

get_job_status

Get status and results of a ComfyUI job.

Checks execution status and optionally downloads generated images.

Args: prompt_id: The prompt ID returned by execute_workflow server_address: ComfyUI server address download_images: Whether to download generated images image_save_path: Directory to save images (relative to workflows/)

Returns: Job status with completion info and image paths if downloaded

Examples: get_job_status("12345-abcde-67890") get_job_status("12345-abcde-67890", download_images=True)

list_comfyui_queue

List current ComfyUI execution queue.

Shows running and pending jobs in the ComfyUI queue.

Args: server_address: ComfyUI server address

Returns: Queue information with running and pending jobs

Examples: list_comfyui_queue() list_comfyui_queue("192.168.1.100:8188")

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription
example_simpleBasic text-to-image workflow example
example_flux_kontextFlux Kontext workflow example (converted from real workflow)
template_catalogComplete template catalog with descriptions and examples
template_getting_startedTemplate usage guide and examples
docs_syntaxDSL syntax reference and examples

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/christian-byrne/comfy-mcp'

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