Skip to main content
Glama

vary_workflow

Generate multiple workflow variants by sweeping slot value lists across a ComfyUI workflow. Streams NDJSON to stdout or writes JSON files.

Instructions

Fan a frontend-format workflow out into variants over slot value lists.

Wraps comfy workflow vary <path> --slot "ADDR=[v1,v2,...]" [--slot ...], one entry per address (from list_workflow_slots). comfy-cli ZIPS the value lists — every list MUST be the same length.

Each slots entry may be EITHER form, mixed in one list:

  • Structured (preferred){"address": "6.text", "values": ["a cat", "a dog"]}. Type PRESERVED EXACTLY; no quoting gotcha.

  • String'6.text=["a cat", "a dog"]'. Parsed as JSON and MUST be a JSON ARRAY — a value with a comma/spaces (a prompt) must be JSON-quoted or it reads as one bare string and fails. A single value still needs its array ("3.seed=[42]", not "3.seed=42"). Pre-checked here, naming the offending entry before shelling out.

With out_dir unset (default), variants stream as NDJSON to stdout; set it to write <stem>_<N>.json files instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slotsYes
out_dirNo
workflow_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and it delivers: it discloses the zip constraint (equal list lengths), type preservation, the quoting footgun and its mitigation, the pre-check behavior (naming the offending entry), and the output routing (stdout NDJSON vs files). This is comprehensive and leaves little to discover at call time.

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 long but justified by the complexity of the slots parameter. It uses clear structural elements: a bolded 'Structured (preferred)' vs 'String' split, bullet points, and inline code examples. It stays front-loaded with the main purpose, but the extensive detail is necessary to prevent misuse. Slightly dense, but not redundant.

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

Completeness5/5

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

For a tool with a mixed union parameter, quoting dangers, and no output schema, the description covers all required ground: input format constraints, error pre-checks, output behavior, and a reference to a sibling tool (list_workflow_slots) for sourcing addresses. Nothing an agent needs to call it correctly is missing.

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

Parameters4/5

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

Schema coverage is 0% for the top-level parameters, so the description must explain each. It does so well: slots is thoroughly documented with both forms and examples, out_dir is explicitly described (unset default → stdout), and workflow_path is implied via the wrapped CLI command ('comfy workflow vary <path>'). The only minor gap is that workflow_path isn't explicitly named, but it's inferable from context.

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

Purpose5/5

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

The description opens with a specific verb and resource: 'Fan a frontend-format workflow out into variants over slot value lists.' It clearly distinguishes this from siblings like run_workflow by framing it as a variant-generation operation, and it further differentiates the two input forms (structured vs string). This is unambiguous and specific.

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

Usage Guidelines3/5

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

The description gives concrete usage mechanics: it wraps a CLI command, tells the user to get addresses from list_workflow_slots, and explains the output behavior. However, it never explicitly contrasts this tool with alternatives like run_workflow or set_workflow_slot, so an agent is left to infer when to pick this over those. The when-not-to-use guidance is absent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.