Skip to main content
Glama

Generate Image with Nano Banana

nanobanana_generate_image
Idempotent

Generate images from text prompts using Gemini AI models, saving them to specified file paths with configurable aspect ratios and quality options.

Instructions

Generate an image using Gemini's native image generation (Nano Banana).

This tool calls the Gemini API to generate an image based on your text prompt and saves it to the specified path.

Models:

  • gemini-2.5-flash-image: Fast, efficient (~$0.039/image)

  • gemini-3-pro-image-preview: Higher quality, supports 4K (~$0.134-0.24/image)

Supported Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4

Example:

prompt: "A modern flat illustration of a workflow diagram with three connected nodes, purple and blue gradient colors, minimal style"
output_path: "assets/generated/workflow-hero.png"
model: "gemini-2.5-flash-image"
aspect_ratio: "16:9"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesImage generation prompt describing the desired image
output_pathYesRelative or absolute path to save the generated image (e.g., 'assets/generated/hero.png')
modelNoGemini model to use. Flash for speed, Pro for qualitygemini-2.5-flash-image
aspect_ratioNoAspect ratio of the generated image
overwriteNoIf true, overwrite existing file. If false, skip if file exists
Behavior4/5

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

Annotations provide readOnlyHint=false, openWorldHint=true, idempotentHint=true, and destructiveHint=false. The description adds valuable context beyond annotations: it explains cost implications of different models, supported aspect ratios, and the file-saving behavior with overwrite option. This enhances understanding of the tool's operational characteristics.

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 efficiently structured with clear sections (overview, models, aspect ratios, example) and every sentence adds value. The example is particularly helpful for understanding usage without being verbose. The information is well-organized and front-loaded.

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?

Given the complexity of an image generation tool with 5 parameters and no output schema, the description provides good context about models, costs, aspect ratios, and file handling. However, it doesn't explain what the tool returns (e.g., success confirmation, error handling) or provide guidance on prompt engineering best practices.

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?

With 100% schema description coverage, the schema already documents all 5 parameters thoroughly. The description adds minimal additional semantic context through the example showing typical usage patterns, but doesn't provide significant new information beyond what's in the schema descriptions.

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 specific action ('Generate an image'), resource ('using Gemini's native image generation'), and distinguishes from siblings by focusing on image creation rather than queue management. It provides a concrete example that reinforces the purpose.

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 through the example and model descriptions, suggesting when to choose different models based on speed vs. quality. However, it doesn't explicitly state when to use this tool versus the queue-related siblings or provide clear exclusions or alternatives.

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/keeponfirst/kof-nanobanana-mcp'

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