Skip to main content
Glama

read_workflow

Read a workflow file from the configured directory using its relative path to access ComfyUI templates for AI image generation orchestration.

Instructions

Read a specific workflow file by its relative path inside the configured workflow directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relative_pathYes

Implementation Reference

  • The @server.tool decorator registers and defines the handler function for the 'read_workflow' tool. It reads the workflow file content using WorkflowRepository.read, attempts to parse it as JSON, and returns a dictionary with the relative path, raw text, and parsed JSON object.
    @server.tool( name="read_workflow", description=( "Read a specific workflow file by its relative path inside the" " configured workflow directory." ), ) async def read_workflow(relative_path: str, context: Context | None = None) -> dict[str, Any]: """Return the contents of a workflow JSON file.""" text = await anyio.to_thread.run_sync(workflow_repo.read, relative_path) parsed: Any try: parsed = json.loads(text) except json.JSONDecodeError: parsed = None if context is not None: await context.info(f"Read workflow {relative_path}") return { "relative_path": relative_path, "text": text, "json": parsed, }
  • Tool registration via @server.tool decorator specifying the name 'read_workflow' and its description.
    @server.tool( name="read_workflow", description=( "Read a specific workflow file by its relative path inside the" " configured workflow directory." ), )

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/neutrinotek/ComfyUI_MCP'

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