Skip to main content
Glama

generate_image

Generate images from text descriptions, optionally using reference images to match style or edit existing pictures, and return local file paths.

Instructions

Generate one or more images from a description and write them to disk, returning their paths. Optionally takes REFERENCE IMAGES (paths on this machine) and extra text context, both of which steer the result: use them to match an existing style, keep a character or product consistent, or edit an image you already have. Defaults to OpenAI GPT Image 2; pass style as gemini/nanobanana, gemini-pro, photoreal (Recraft), seedream, or grok. For a REAL editable SVG set svg: true, which routes to Arrow; the raster models can only imitate one. A billed call per image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoHow many images. Defaults to 1, capped at 4 by this server. Each one is billed.
svgNoGenerate a REAL SVG: vector source you can open, edit and scale, from Arrow 1.1. Set this whenever the user asked for an SVG, a logo, an icon, or a diagram. Overrides `style`. Note that the raster models cannot produce an SVG; they can only produce a picture that looks like one.
seedNoSeed, where the provider supports one, for a repeatable result.
sizeNoExact pixel size, e.g. 1024x1024. Provider support varies; unsupported values come back as a warning.
styleNoWhich model. Omit for the default (openai). Accepted: openai, gpt-image, gpt-image-2, dalle, google, gemini, nanobanana, nano-banana, nano banana, gemini-pro, geminipro, gemini-3-pro, bytedance, seedream, quiver, quiverai, grok, xai, imagine, recraft, photo, photoreal, photorealistic, arrow, svg. "seedream" and "svg"/"arrow" need the gateway key.
promptYesWhat to generate. Detail helps: subject, composition, lighting, style, and what to leave out.
contextNoExtra text context appended to the prompt: brand rules, a palette, what the surrounding page says, things to avoid. Kept separate from `prompt` so the subject stays legible.
basenameNoFilename stem, e.g. "hero". A short random suffix is always added so a second call cannot overwrite the first.
outputDirNoWhere to write the images. Defaults to IMAGE_GEN_OUTPUT_DIR, or the current working directory.
aspectRatioNoAspect ratio, e.g. 16:9. Use instead of `size` when the exact pixels do not matter.
referenceImagesNoPaths to images on THIS machine to use as visual context: a style to match, a product to keep consistent, or an image to edit. Read by the server, so absolute paths are safest. Not URLs, and not base64.
Behavior4/5

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

The description adds meaningful behavioral context beyond annotations: it notes that writes to disk, that each image is billed, and that reference images must be paths on this machine (not URLs/base64). It also clarifies the SVG limitation of raster models. This goes beyond the basic readOnlyHint/destructiveHint annotations.

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?

The description is dense yet efficient, covering all essential aspects in a few sentences without redundancy. Every sentence contributes new information, and the flow from purpose to optional flags to model selection is logical.

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?

Given the tool's complexity (11 parameters, no output schema), the description is remarkably complete: it covers the return format (paths), the default model, style options, the SVG distinction, reference image constraints, and cost per image. It leaves little ambiguity for an agent.

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?

With 100% schema coverage, the baseline is 3, but the description adds valuable semantics: it explains the purpose of referenceImages, context, the svg flag override, and the billing implication of n. This helps the agent choose parameters more effectively than schema alone.

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 clearly states the tool's function: generating images from a description, writing them to disk, and returning paths. It also distinguishes itself from potential alternatives by mentioning reference image support and SVG generation, making the purpose concrete and actionable.

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

Usage Guidelines4/5

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

The description provides explicit when-to-use guidance for reference images (matching style, consistency, editing) and SVG mode (whenever the user asks for an SVG, logo, icon, or diagram). It lacks a direct 'when not to use this tool' but given no sibling tools, the context is sufficient.

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

Install Server

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/fledgeling-co/image-gen-pro-mcp'

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