Skip to main content
Glama

submit_workflow

Submit a ComfyUI workflow for asynchronous execution and receive a prompt ID for tracking progress without waiting for completion.

Instructions

Submit a workflow without waiting for completion.

    Args:
        workflow: Workflow dict to execute

    Returns the prompt_id for tracking.
    Use get_history() or get_prompt_status() to check completion.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflowYesWorkflow to submit

Implementation Reference

  • The handler function for the 'submit_workflow' tool. It submits the workflow to ComfyUI via POST /prompt and returns the prompt_id, number, and any node_errors without waiting for completion. Includes input schema via Pydantic Field descriptions and is registered via @mcp.tool() decorator.
    @mcp.tool()
    def submit_workflow(
        workflow: dict = Field(description="Workflow to submit"),
        ctx: Context = None,
    ) -> dict:
        """Submit a workflow without waiting for completion.
    
        Args:
            workflow: Workflow dict to execute
    
        Returns the prompt_id for tracking.
        Use get_history() or get_prompt_status() to check completion.
        """
        if ctx:
            ctx.info("Submitting workflow...")
    
        status, resp = comfy_post("/prompt", {"prompt": workflow})
    
        if status != 200:
            return ErrorResponse(
                error=f"Submit failed: status {status}",
                code="SUBMIT_FAILED",
                details=resp,
            ).model_dump()
    
        return {
            "prompt_id": resp.get("prompt_id"),
            "number": resp.get("number"),
            "node_errors": resp.get("node_errors", {}),
        }
  • Within register_all_tools, calls register_execution_tools(mcp) which defines and registers the submit_workflow tool using @mcp.tool().
    register_workflow_tools(mcp)
    register_execution_tools(mcp)
  • Top-level registration call to register_all_tools(mcp), which chains to register_execution_tools(mcp) and thus registers the submit_workflow tool.
    register_all_tools(mcp)
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: the tool submits asynchronously and returns a prompt_id for tracking, which is essential context. However, it lacks details on error handling, rate limits, permissions, or what constitutes a valid 'workflow dict', leaving gaps for a mutation tool.

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 front-loaded with the core purpose, followed by efficient bullet points for args and returns. Every sentence earns its place by providing essential information without redundancy, making it highly readable and to-the-point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (asynchronous submission with tracking) and no annotations or output schema, the description covers the basic flow but lacks details on error cases, workflow validation, or response format beyond prompt_id. It's adequate for minimal use but incomplete for robust agent operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents the single parameter 'workflow' as an object. The description adds minimal value by restating 'Workflow dict to execute' without explaining the structure or requirements. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('submit a workflow') and distinguishes it from waiting for completion, which differentiates it from siblings like 'execute_workflow' or 'run_workflow' that might imply synchronous execution. However, it doesn't explicitly contrast with all similar tools (e.g., 'run_workflow'), leaving some ambiguity.

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 provides clear context on when to use this tool ('without waiting for completion') and explicitly names alternative tools for checking status ('get_history() or get_prompt_status()'). It doesn't specify when NOT to use it or compare with all siblings like 'execute_workflow', but the guidance is practical and actionable.

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

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