Skip to main content
Glama

generate_image

Turn text descriptions into images by selecting a model, aspect ratio, and number of images. Save results as high-resolution PNGs or preview inline.

Instructions

Generate image(s) from a text prompt.

Args:
    prompt: The text description of the image to generate.
    model: Friendly alias — nano-banana (default), nano-banana-pro, imagen-4,
        imagen-4-fast, imagen-4-ultra. Call list_models for details.
    aspect_ratio: e.g. "1:1", "16:9", "9:16". Allowed values depend on the model.
    n: Number of images (Gemini loops one per call; imagen-4-ultra supports 1 only).
    output_dir: Where to save the full-res PNG(s). Defaults to env
        GEMINI_IMAGE_OUTPUT_DIR, else the server's CWD.
    return_image: When True, append a downscaled preview of the first image.

Returns:
    A list of text lines (one per saved absolute path), optionally followed by a
    downscaled preview Image of the first result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
modelNonano-banana
promptYes
output_dirNo
aspect_ratioNo1:1
return_imageNo
Behavior4/5

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

No annotations provided, so the description carries full burden. It discloses key behaviors: loop behavior for multiple images, per-model limits (imagen-4-ultra supports 1), file saving to output_dir with fallback defaults, and preview return via return_image. It could mention side effects of file writes explicitly, but overall it is transparent.

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 description is structured with a one-line summary, detailed Args section, and Returns. It is longer but each sentence is informative. No redundancy; it could be slightly more concise in the Returns description, but overall well-organized.

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?

With 6 parameters (1 required), no output schema, and no annotations, the description covers all input details, explains default behavior, and describes the return value (list of paths and optional image). It mentions limitations like model-specific constraints. It is complete for an agent to invoke correctly.

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

Parameters5/5

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

Schema coverage is 0%, so description must explain parameters. It does so thoroughly: prompt (text description), model (friendly aliases with examples), aspect_ratio (with examples and note on model-dependence), n (number with loop behavior), output_dir (default path logic), return_image (preview). This adds significant meaning 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?

The description starts with 'Generate image(s) from a text prompt,' which is a clear, specific verb and resource. The sibling tools 'edit_image' and 'list_models' are distinct, so no confusion.

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?

While the description does not explicitly state when to use this tool versus siblings, the focus on generation from text prompts implicitly distinguishes it from editing or model listing. A more explicit usage guideline would be better but is not necessary given clear sibling names.

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/someshwarpatil/gemini-image-mcp'

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