Skip to main content
Glama

Generate Image

gemini_generate_image

Generate an image from a text prompt using Google Gemini. Supports multiple aspect ratios and model options.

Instructions

Generate an image from a text prompt using the Google Gemini Nano Banana image generation model.

Args:

  • prompt (string, required): A detailed description of the image to generate.

  • aspect_ratio (string, optional): Aspect ratio for the output image. Supported: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

  • model (string, optional): Gemini model ID to use. Defaults to "gemini-3.1-flash-image-preview".

  • output_path (string, optional): File path to save the generated image.

Returns:

  • The generated image as an embedded image block (and optionally saved to disk).

  • Any text the model returns alongside the image.

Examples:

  • "A photorealistic golden retriever surfing a wave at sunset"

  • "An isometric pixel-art castle on a floating island"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoGemini model ID (default: gemini-3.1-flash-image-preview)gemini-3.1-flash-image-preview
promptYesA detailed text description of the image to generate
image_sizeNoOutput image resolution: "1K" (1024px), "2K" (2048px), or "4K" (4096px)
output_pathNoOptional file path to save the generated image
aspect_ratioNoAspect ratio for the output image. Supported: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Behavior3/5

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

Annotations already indicate non-readOnly and non-destructive. The description adds that the tool returns an embedded image block and optionally saves to disk. However, it does not disclose potential side effects like cost or latency. The mention of 'Gemini Nano Banana' model might be outdated but does not contradict 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 well-structured with Args, Returns, and Examples sections. Every sentence adds value, and the main purpose is front-loaded. No redundant or unnecessary text.

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

Completeness2/5

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

Despite having 5 parameters and no output schema, the description omits the image_size parameter, leading to incomplete parameter documentation. It also does not explain return values beyond mentioning an embedded image block. For a tool with moderate complexity, this is a notable gap.

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 covers all parameters with descriptions (100% coverage). The description adds value by providing examples and repeating key parameter info in a more readable format. However, it omits the image_size parameter entirely, missing a chance to add context beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it generates an image from a text prompt, specifying the model. It implicitly distinguishes from siblings like edit_image or upload_image by focusing on generation, but does not explicitly contrast them, preventing a top score.

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

Usage Guidelines2/5

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

No guidance on when to use this tool vs alternatives like gemini_edit_image. The description only states what it does, not when it is appropriate or when not to use it.

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/slackermafia/NanoBanana-MCP-Server'

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