Skip to main content
Glama

Generate image (Nano Banana)

generate_image

Create an image from a text prompt using Google Gemini models, with automatic model selection, aspect ratio and size control, and optional saving to disk.

Instructions

Generate an image from a text prompt using Google's Gemini image models (the Nano Banana family). By default, automatically picks Nano Banana 2 (fast) or Nano Banana Pro (deeper reasoning) based on the prompt's complexity — pass an explicit model to override. Returns the image inline and optionally saves it to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoModel id or alias. "auto" (default) smart-selects between Nano Banana 2 and Nano Banana Pro based on prompt complexity. Known aliases: nb2/nano-banana-2 (gemini-3.1-flash-image), pro/nano-banana-pro (gemini-3-pro-image), legacy/nano-banana (gemini-2.5-flash-image, not auto-selected). Any other Gemini image-capable model id is accepted and passed through as-is.
promptYesDescription of the image to generate. Be specific: subject, setting, style, lighting, camera angle, and any exact text that must appear in the image.
image_sizeNo"4K" only on Nano Banana 2 / Nano Banana Pro. Defaults to 1K.
output_pathNoFile path or directory to save the image to. Relative paths resolve against NANOBANANA_OUTPUT_DIR (or the system temp dir if unset), not the current working directory.
aspect_ratioNoAspect ratio of the output image. Defaults to the model's default (usually 1:1) when omitted.
save_to_fileNoAlso write the generated image(s) to disk (and make them browsable via the generated-image:// resource). Defaults to true when NANOBANANA_OUTPUT_DIR is set, false otherwise.
thinking_levelNo"high" improves complex prompts at the cost of latency. Only affects Nano Banana 2 (ignored otherwise).
person_generationNoControls generation of people in the image.
use_search_groundingNoGround the image in real-time Google Search results (e.g. current weather, sports scores, recent events). Not supported on the legacy model.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

No annotations exist, so the description carries the full burden. It usefully discloses the auto-model-selection logic and that the image is returned inline and optionally written to disk, but it says nothing about auth requirements, latency/cost tradeoffs beyond the thinking_level note, rate limits, or content-policy failure modes.

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?

Three sentences, front-loaded with the core action and model family, followed by the model-selection rule and return behavior. No filler and every clause carries information.

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 9-parameter generation tool with no output schema, the description covers the essentials: generation source, model-selection behavior, and return/save format. It stops short of describing permissions or failure behavior, but the rich schema compensates for most parameter detail.

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 every parameter in detail. The description only restates the model default/override behavior, adding no meaningful semantics beyond what the schema provides; baseline 3 applies.

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 (generate) and resource (image) plus the backing model family, which is far beyond a tautology. The distinction from the sibling edit_image is only implicit (this creates from a prompt rather than modifying an existing image), but the purpose itself is unambiguous.

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?

Explicitly explains the default behavior (auto-selects Nano Banana 2 vs Pro by prompt complexity) and the condition for overriding it via the model parameter. It does not say when to prefer this tool over edit_image or render_template, so full routing guidance is missing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.