validate_workflow
Check workflow syntax for errors before execution. Parses DSL content to identify issues and returns validation results with specific error details.
Instructions
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)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dsl | Yes |
Implementation Reference
- comfy_mcp/mcp/server.py:241-277 (handler)The main handler function for the 'validate_workflow' tool, decorated with @mcp.tool. It validates DSL syntax by attempting to parse it with DSLParser and returns a dictionary indicating validity, errors, and basic stats like node and section counts.@mcp.tool def validate_workflow(dsl: str) -> dict: """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) """ try: parser = DSLParser() workflow_ast = parser.parse(dsl) # If parsing succeeded, it's valid return { "is_valid": True, "errors": [], "warnings": [], "node_count": sum(len(section.nodes) for section in workflow_ast.sections), "section_count": len(workflow_ast.sections) } except Exception as e: return { "is_valid": False, "errors": [str(e)], "warnings": [], "message": "DSL syntax error" }