Skip to main content
Glama

batch_generate

Start non-blocking batch image generation from up to 20 text prompts and receive a batch ID immediately; poll batch progress to retrieve finished image file paths.

Instructions

Start a batch image generation (returns immediately, does NOT block).

Returns a batch_id immediately. Images generate in the background.

IMPORTANT WORKFLOW:

  1. Call batch_generate → returns batch_id

  2. WAIT 50 SECONDS before calling check_batch_progress (images need time to generate)

  3. Call check_batch_progress(batch_id) — if still in_progress, WAIT another 50 seconds and repeat

  4. When status is "completed", the response contains all results and file paths

Do NOT call check_batch_progress immediately — always wait 50 seconds between calls.

Each prompt should follow the same rules as generate_image: natural language prose, subject first, explicit lighting, 30-80 words each, no quality tags.

Args: prompts: List of natural language text prompts (max 20). Each prompt should be descriptive prose, not comma-separated tags. output_dir: Directory to save all images. Provide a path appropriate for the user's project. width: Width for all images in pixels. height: Height for all images in pixels. aspect_ratio: Aspect ratio shortcut for all images. FLUX Klein supports up to 4K (e.g. "16:9_4k"). num_inference_steps: Steps for all images. guidance_scale: CFG scale for all images. seeds: List of seeds (must match prompts length if provided). max_concurrent: Override concurrent limit (auto-detected if omitted). format: Output image format for all images. Options: "png" (default), "jpg", "webp". Choose based on context.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompts": "<prompts>",
      "output_dir": "<output_dir>"
    },
    "name": "batch_generate"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedsNo
widthNo
formatNopng
heightNo
promptsYes
output_dirYes
aspect_ratioNo
guidance_scaleNo
max_concurrentNo
num_inference_stepsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false); the description adds the genuinely useful behavior beyond that — asynchronous non-blocking execution, background generation, and the polling cadence required to avoid empty reads. It stops short of failure modes (what happens on an invalid seed list, what an over-limit max_concurrent does, whether partial failures are reported), which keeps it off a 5.

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 blocking behavior and the workflow are front-loaded, and the Args block is justified because the schema carries zero parameter documentation. A few lines are filler — "Choose based on context" for format and the redundant restatement of generate_image's prompt rules — but overall the length earns its keep.

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 10-parameter async tool, an agent has everything needed to call it and then correctly poll: required inputs, prompt constraints, seed alignment rule, non-blocking semantics, and the fact that the completed response carries results and file paths (further backed by an output schema). Nothing essential 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 description coverage is 0%, so the description is the only source of parameter meaning, and it covers all ten: prompts (max 20, prose not comma-separated tags, 30–80 words), output_dir, width/height, aspect_ratio with a format example ("16:9_4k"), steps, guidance_scale, seeds (must match prompts length), max_concurrent (auto-detected if omitted), and format with enumerated options and default. It omits value ranges and defaults for width/height/steps/guidance, so it falls just short of fully compensating.

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?

States a specific verb and resource ("Start a batch image generation") and immediately declares the defining trait: returns immediately, does NOT block. That distinguishes it cleanly from the single-image sibling generate_image and pairs it with check_batch_progress, so an agent can route correctly without opening a schema.

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

Usage Guidelines5/5

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

Gives an explicit numbered workflow with sequencing, a concrete 50-second wait interval, a named follow-up tool (check_batch_progress(batch_id)), the terminal condition ("completed"), and an explicit prohibition ("Do NOT call check_batch_progress immediately"). This is exactly the when/when-not guidance the dimension asks for.

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