Skip to main content
Glama

Generate Image

generate_image

Generate or EDIT an image. This is the tool for ALL image models (kind=image — flux-1-schnell, recraft-v3, gpt-image-2, gemini-3.1-flash-image, nano-banana, etc.). Synchronous — the call returns when the image is done: about 5 s for flux-1-schnell, 10–40 s for most others, usually under 2 min for gpt-image-2 at high quality — keep the connection open up to 5 min (the server's limit); if your client times out, retrying the identical call while it still runs returns the same image without a second charge. Returns { imageUrl, modelId } DIRECTLY — there is no job to poll and no get_job step (that's video only). IMAGE-TO-IMAGE: pass referenceImageUrl (a public image URL) to edit/restyle a source image while preserving its subjects — use modelId "nano-banana" for best identity/element preservation (e.g. keep a logo or face, redesign around it). Only models whose supports include image-to-image (list_models with modelId shows it; plus flux-1.1-pro, which uses it as a style prompt) take a reference; others refuse it. Do NOT pass image models to generate_video. For end-user choice among candidates, prefer pick_reference_images. Scope required: generate:image.

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": {
      "prompt": "<prompt>"
    },
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYesWhat to generate, or for an edit what to change (at least 3 characters).
modelIdNoImage model id from list_models (kind image). Default flux-1-schnell.flux-1-schnell
aspectRatioNoImage shape. Default 16:9.16:9
referenceImageUrlNoPublic URL of a source image to edit or restyle (image-to-image); nano-banana preserves subjects best. Omit for text-to-image.
reference_image_urlNoAlias of referenceImageUrl (the spelling generate_video uses), used only when that is not sent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / aspectRatio / description
      Added value: +"Image shape. Default 16:9."
    • addedInput schema / properties / modelId / description
      Added value: +"Image model id from list_models (kind image). Default flux-1-schnell."
    • addedInput schema / properties / prompt / description
      Added value: +"What to generate, or for an edit what to change (at least 3 characters)."
    • addedInput schema / properties / referenceImageUrl / description
      Added value: +"Public URL of a source image to edit or restyle (image-to-image); nano-banana preserves subjects best. Omit for text-to-image."
    • addedInput schema / properties / reference_image_url
      Added value: +{
      +  "description": "Alias of referenceImageUrl (the spelling generate_video uses), used only when that is not sent.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well past the annotations, which only declare openWorldHint=true and destructiveHint=false. It discloses synchronous execution with per-model latency (5 s to ~2 min), a 5-minute server ceiling, client-timeout behavior, and the key retry/idempotency guarantee that an identical retry returns the same image without a second charge. It also warns that non-supporting models will refuse a reference image.

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 core action and scope lead, followed by timing, return shape, and the image-to-image branch in a logical order. It is dense with parentheticals and embedded asides, which costs some scannability, but almost every clause carries actionable information rather than filler.

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 5-parameter generative tool with no output schema, it supplies everything the agent needs: return shape ({ imageUrl, modelId }), that no job exists to poll, expected wall-clock time, and which model to pick when identity preservation matters. Nothing material for correct invocation 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 100%, so the baseline is 3; the description earns more by adding model-selection semantics the schema lacks — use nano-banana for best identity/element preservation, flux-1.1-pro treats the reference as a style prompt, others reject it. It also clarifies the referenceImageUrl vs reference_image_url alias precedence, though the schema already documents that.

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 pair (generate/EDIT) and resource, and explicitly claims the whole image-model family with named examples (flux-1-schnell, recraft-v3, gpt-image-2, nano-banana). It separates itself from generate_video and the get_job polling path in the same breath, so no sibling confusion is possible.

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 explicit routing rules: do NOT pass image models to generate_video, use pick_reference_images for end-user choice among candidates, use list_models to check image-to-image support, and use generate_video for anything requiring polling. It also states the precondition (scope generate:image) needed before calling.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.