Skip to main content
Glama

generate_image

Generate image(s) from a text prompt, optionally with reference images (editing / image-to-image). Waits briefly for completion and usually returns the finished image inline (URL + small preview). Cost in credits is returned.

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
seedNoFixes randomness. Only for models that declare seed (see get_model); a model known not to apply it — including the default image model — rejects the call. For distinct variants use num_images, or separate calls with a different idempotency_key each — identical calls within ~20s are de-duplicated to one generation.
inputNoModel-specific parameters from get_model input_schema.parameters, keyed by parameter name and merged with the fields above. Some of them (e.g. quality, image_size, image_resolution) change the cost of the call — get_model shows the reference pricing. A misspelled name, or a parameter this model is known not to apply, is rejected before the generation starts; the error lists the parameters the model declares.
modelNoModel slug from list_models (slugs may contain '/', e.g. 'google/imagen4' — pass verbatim). Omit to use the default image model.
promptYesWhat to generate. Russian or English.
image_urlsNoPublic https URLs of reference images for editing / image-to-image, or several (2–10, model-dependent) to merge subjects, products and styles into one image.
num_imagesNoHow many images to generate in ONE call (model-dependent). Prefer this for multiple variants of a prompt — they come back together as a single tiled result. For variants via separate calls, pass a different idempotency_key each.
resolutionNoOutput resolution, e.g. '1K', '2K', '4K'. Only for models that declare resolution (see get_model).
aspect_ratioNoAspect ratio, e.g. '1:1', '16:9', '9:16', '4:3', '3:4'. Model-dependent.
wait_secondsNoHow long to wait inline for completion before returning a request_id.
idempotency_keyNoOptional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse.
include_previewNoAttach a small inline preview of the finished image to the result.
negative_promptNoWhat to avoid. Only for models that declare negative_prompt (see get_model); a model known not to apply it rejects the call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / idempotency_key / description
      Previous value: -"Optional stable key to safely retry without creating a duplicate generation. Reuse the same key when retrying the same request."New value: +"Optional stable key (up to 255 characters) to safely retry without creating a duplicate generation. Reuse the same key only when retrying the same request: the same key with a different model or input is rejected with idempotency_key_reuse."
    • addedInput schema / properties / idempotency_key / maxLength
      Added value: +255
  2. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the annotations, it discloses the inline wait behavior, the typical return shape (URL + small preview), and that credit cost is returned — useful operational context. It stops short of describing what happens on timeout or failure, and the idempotency_key guidance lives only in the schema.

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?

Two tight sentences, front-loaded with the core action and followed by the return/cost behavior. No filler or redundancy.

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 12-parameter tool with a nested input object and no output schema, the description covers the essentials an agent needs: what it produces, that it may return early, and that cost is reported. The async follow-up path is the main omission.

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 the schema already carries the parameter burden. The description only adds the notion of optional reference images, which maps to image_urls; it adds no syntax or format detail beyond the schema.

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 ('Generate image(s) from a text prompt') plus the optional editing/image-to-image mode, which cleanly separates it from siblings like generate_video, generate_audio, and compose_video.

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 implies usage context (text-to-image vs. reference-image editing) and hints that a request_id may come back when the wait is short, but it never explicitly names get_generation or wait_generation as the follow-up path, nor when to prefer this over generate_video.

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.