Skip to main content
Glama

generate_image

Create PNG images from text prompts, optionally guided by reference images, and save them to disk. Uses OpenAI Images API with automatic fallback to local ComfyUI when rate-limited or unavailable.

Instructions

Generates a PNG image and saves it to disk. Tries the OpenAI Images API first (when OPENAI_API_KEY is set); when it is rate-limited or unavailable, falls back automatically to Qwen-Image 2.1 on the local ComfyUI server. Returns the file paths and the backend used.

Input Schema

NameRequiredDescriptionDefault
formatNoportrait (default): 1024x1536 on OpenAI, 768x1376 on ComfyUI. square: 1:1. landscape: the portrait sizes rotated.
outputNoFolder or .png file to save to. Default: the image folder, in a subfolder per day.
promptYesWhat the image must contain. English works best.
backendNoauto (default): OpenAI, then ComfyUI when OpenAI is rate-limited or unavailable. openai / comfyui: only that backend.
qualityNoOpenAI only. Default: the model default.
variantsNoHow many variants (default 1).
referencesNoPaths to reference images (character, place, style); with them the image is made by editing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses backend fallback ordering, the OPENAI_API_KEY prerequisite, rate-limit/unavailability triggers, and that results are written to disk. It doesn't cover what happens when both backends fail, or any cost/latency tradeoffs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences, front-loaded with the action and output, followed by routing behavior and return shape. No filler; each sentence adds information.

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

Completeness4/5

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

For a multi-backend generation tool with no output schema, the description usefully states the return value ('file paths and the backend used') and the fallback behavior. The only gap is failure behavior when both backends are unavailable.

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

Parameters3/5

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

Schema description coverage is 100%, so all seven parameters including enums and limits are already documented. The description only echoes the backend fallback already stated in the 'backend' field and adds no new parameter-level meaning.

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 ('Generates a PNG image and saves it to disk') plus the multi-backend routing, so an agent knows exactly what the call produces. No sibling tools exist, so no differentiation is needed.

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 explains the default backend-selection logic (OpenAI first, ComfyUI on rate-limit/unavailability), which is useful context, but it never says when to call this tool versus not calling it, nor when an agent should override the 'auto' default.

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

Deploy Server

Other Tools