Skip to main content
Glama

run_workflow_from_json

Execute ComfyUI workflows by providing JSON data to generate images through natural language interactions.

Instructions

Run a workflow from a JSON data.

Args:
    json_data: The JSON data to run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
json_dataYes

Implementation Reference

  • The handler function for the 'run_workflow_from_json' MCP tool, registered via @mcp.tool(). It receives JSON workflow data, initializes a ComfyUI client, and executes the workflow, returning the generated images.
    @mcp.tool()
    async def run_workflow_from_json(json_data: dict) -> Any:
        """Run a workflow from a JSON data.
        
        Args:
            json_data: The JSON data to run.
        """
        workflow = json_data
        
        auth = os.environ.get("COMFYUI_AUTHENTICATION")
        comfy = ComfyUI(
            url=f'http://{os.environ.get("COMFYUI_HOST", "localhost")}:{os.environ.get("COMFYUI_PORT", 8188)}',
            authentication=auth
        )
        images = await comfy.process_workflow(workflow, {}, return_url=os.environ.get("RETURN_URL", "true").lower() == "true")
        return images
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what the tool does at a surface level without explaining what 'run a workflow' entails - whether it's a read or write operation, what permissions are needed, what happens when executed, or what the expected outcomes are. This leaves significant behavioral questions unanswered.

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 appropriately concise with two sentences. The first states the purpose, the second documents the single parameter. There's no unnecessary verbiage, though the structure could be improved by front-loading more critical information about workflow behavior.

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

Completeness2/5

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

For a tool that presumably executes workflows (potentially complex operations), with no annotations, no output schema, and minimal parameter documentation, the description is incomplete. It doesn't address what 'running a workflow' means, what types of workflows exist, what happens upon execution, or what results to expect.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. While it mentions 'json_data: The JSON data to run', this adds minimal semantic value beyond the parameter name. It doesn't explain what structure the JSON should have, what fields are expected, or provide any examples of valid JSON data for running workflows.

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

Purpose3/5

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

The description states the tool 'Run a workflow from a JSON data' which provides a basic verb+resource combination. However, it's vague about what 'workflow' means in this context and doesn't differentiate from sibling tools like 'run_workflow_from_file' which appears to serve a similar purpose with different input format.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus alternatives. The existence of 'run_workflow_from_file' suggests there are multiple ways to run workflows, but the description offers no comparison or context about when JSON input is preferred over file input.

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/Overseer66/comfyui-mcp-server'

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