Skip to main content
Glama

Edit / compose image (Nano Banana)

edit_image

Edit, inpaint, restyle, or compose up to 14 reference images with Gemini Nano Banana models; auto-picks Nano Banana 2 or Pro by prompt complexity.

Instructions

Edit, inpaint, restyle, or compose one or more reference images using Gemini's Nano Banana models. Accepts local file paths or inline base64 image data. By default, automatically picks Nano Banana 2 or Nano Banana Pro based on prompt complexity and reference-image count.

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.
imagesYes1-14 reference images, each as either a local file path or inline base64 data. Order matters when the prompt refers to "the first image" / "the second image".
promptYesEditing instructions: what to add, remove, or change, or how to combine the provided image(s). Describe the desired result, not the mechanics of the edit.
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

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full load. It does disclose useful behavior: accepted input forms (local path or inline base64) and automatic model selection by prompt complexity/reference count. It says nothing about side effects, permissions, cost/latency beyond 'high' thinking, or how results are returned when save_to_file is false.

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?

Three compact sentences with the core capability front-loaded and no filler. Efficient and easy to scan, though the third sentence duplicates the schema's 'auto' model description.

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

Completeness3/5

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

For a 10-parameter tool with no annotations and no output schema, the definition covers capabilities and model selection but leaves return behavior ambiguous — e.g. how the agent receives the image when save_to_file is false versus true. Adequate but with a real gap for a heavy tool.

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 baseline is 3. The description's param-related claims ('accepts local file paths or inline base64', auto model picking by prompt complexity and reference-image count) largely restate what the schema already documents for images and model, adding little new meaning.

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?

Specific verbs (edit, inpaint, restyle, compose) plus a clear resource ('one or more reference images') and the backing model family. It implicitly separates itself from generate_image by requiring reference images, but never names or explicitly contrasts with that sibling, so it stops short of a 5.

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?

Usage is implied by 'one or more reference images' (this is the image-to-image path), but there is no explicit when-to-use guidance, no statement of when to prefer generate_image or render_template instead, and no stated prerequisites or exclusions.

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