Skip to main content
Glama
mikeroussell

Nano Banana MCP Server

by mikeroussell

Generate Image with Nano Banana

nanobanana_generate_image
Read-only

Create images from text descriptions using Google's Nano Banana models. Specify details like style, lighting, composition, and aspect ratio for customized visual outputs.

Instructions

Generate high-quality images from text descriptions using Google's Nano Banana models.

This tool creates images from natural language prompts. For best results, be descriptive about:

  • Subject and composition

  • Style (photorealistic, illustration, painting, etc.)

  • Lighting and atmosphere

  • Colors and mood

  • Camera angle and lens (for photorealistic images)

Args:

  • prompt (string, required): Text description of the image to generate

  • model (string): Model to use. Options:

    • 'gemini-3-pro-image-preview' (Nano Banana Pro) - Best quality, 4K, text rendering

    • 'gemini-2.5-flash-image' (Nano Banana) - Fast generation Default: Nano Banana Pro

  • aspect_ratio (string): Image aspect ratio. Options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9

  • resolution (string): Image resolution (Pro only). Options: 1K, 2K, 4K

  • use_google_search (boolean): Enable real-time information grounding (Pro only)

Returns:

  • success (boolean): Whether generation succeeded

  • imageData (string): Base64-encoded image data

  • mimeType (string): Image MIME type (usually image/png)

  • text (string): Any accompanying text from the model

  • error (string): Error message if generation failed

Examples:

  • "A photorealistic portrait of an astronaut on Mars at sunset"

  • "Kawaii-style sticker of a happy corgi with a transparent background"

  • "Minimalist logo for 'TechStart' in blue and white, modern sans-serif font"

Error Handling:

  • Returns error if GEMINI_API_KEY is not set

  • Returns error if API rate limit exceeded (try again later)

  • Returns error if content policy violated

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYesText description of the image to generate. Be descriptive for better results. Include details about style, lighting, composition, colors, and mood.
modelNoModel to use. 'gemini-3-pro-image-preview' (Nano Banana Pro) for best quality and features, 'gemini-2.5-flash-image' (Nano Banana) for faster generation. Default: Nano Banana Progemini-3-pro-image-preview
aspect_ratioNoAspect ratio of the generated image. Options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. Default: varies by prompt
resolutionNoResolution of the generated image (Nano Banana Pro only). Options: 1K, 2K, 4K. Note: Must use uppercase 'K'. Default: 1K
use_google_searchNoEnable Google Search grounding for real-time information (e.g., current weather, news). Only available with Nano Banana Pro. Default: false
Behavior4/5

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

Annotations already indicate read-only and non-destructive behavior, but the description adds valuable context beyond annotations: it explains error handling (API key requirements, rate limits, content policy), provides best practices for prompts, and notes model-specific features (e.g., resolution for Pro only). No contradiction with annotations.

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 well-structured with clear sections (overview, args, returns, examples, error handling) and front-loaded key information. It is appropriately sized but could be slightly more concise by integrating some schema details (e.g., parameter defaults) that are redundant.

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 tool's complexity (5 parameters, no output schema), the description is mostly complete: it covers purpose, parameters, returns, examples, and error handling. However, it lacks explicit guidance on when to use versus sibling tools, and some behavioral details (e.g., response time, cost implications) are not addressed, leaving minor gaps.

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 documents all parameters thoroughly. The description adds minimal extra semantics (e.g., 'For best results, be descriptive' for prompt, model options with quality/fast trade-offs), but does not significantly enhance understanding beyond the schema. Baseline 3 is appropriate given high schema coverage.

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 tool's purpose: 'Generate high-quality images from text descriptions using Google's Nano Banana models.' It specifies the verb ('generate'), resource ('images'), and distinguishes from siblings by focusing on generation rather than composition, editing, or listing models.

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 provides implied usage through examples and best practices (e.g., 'be descriptive about subject, style, lighting'), but does not explicitly state when to use this tool versus alternatives like nanobanana_edit_image or nanobanana_compose_images. No exclusions or prerequisites are mentioned beyond error handling notes.

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/mikeroussell/nano-banana-mcp'

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