Skip to main content
Glama

image_generate

Create images from prompts or edit local images via the Gemini API, saving results to a directory. Refine earlier outputs step by step with previous_id instead of starting over.

Instructions

Create a new image from a prompt, or edit local images, with Nano Banana through the Gemini API, and save the result in GEMINI_PRO_OUTPUT_DIR. Pass previous_id to refine an earlier result step by step ("make the sky darker") without starting over.

COSTS MONEY: about $0.034 (1K), $0.05 (2K) or $0.11 (4K) per image with Nano Banana 2.1; Nano Banana Pro ("gemini-3-pro-image") is $0.13-0.24. No free tier. Confirm with the user before calling.

Args: prompt: What to draw, or how to change the input images, e.g. "Turn this sketch into a clean flat app icon on a white background". model: "gemini-nano-banana-2.1" (default), "gemini-3.1-flash-lite-image" (cheapest, 1K only) or "gemini-3-pro-image" (best, for hard tasks). aspect_ratio: "1:1" (default), "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9" or "21:9". image_size: "1K" (default), "2K" or "4K". input_images: Local image paths to edit or to use as references. previous_id: The id of an earlier image_generate result to refine. file_name: Optional file name; default is the date plus prompt words.

Returns: The saved image path and an id to pass as previous_id for further edits.

Input Schema

NameRequiredDescriptionDefault
modelNogemini-nano-banana-2.1
promptYes
file_nameNo
image_sizeNo1K
previous_idNo
aspect_ratioNo1:1
input_imagesNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare a non-readonly, open-world, non-idempotent write, and the description goes well beyond them: exact per-image pricing by size and model, an explicit 'No free tier' warning, the output directory, and the requirement to confirm with the user first. It also discloses that results are persisted and addressable by id, which the annotations cannot express.

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?

Front-loaded with purpose, then the cost warning, then per-argument notes - a sensible order that puts the highest-stakes information early. It is long, and the 'Returns' line partially duplicates an output schema that already exists, but nearly every sentence earns its place.

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

Completeness5/5

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

For a 7-parameter, costly, open-world generation tool, the description covers cost, model/size tradeoffs, edit-vs-create flow, output location, and the id needed for iterative refinement. With an output schema present, the brief 'Returns' note is sufficient rather than redundant padding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description carries the full burden and does so: every one of the 7 parameters is explained with meaning, allowed values, and defaults, plus tradeoff guidance tying model to cost and image_size. It adds real decision information (e.g. flash-lite is 1K only) that the bare enum in the schema does not convey.

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 first sentence states a specific verb and resource ('Create a new image from a prompt, or edit local images') and names the backend ('Nano Banana through the Gemini API'), which cleanly separates it from the video_* and gemini_ask siblings. It also distinguishes the two modes (fresh generation vs refinement via previous_id) inside the same opening.

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?

Explicit guidance is given for previous_id ('refine an earlier result step by step ... without starting over'), for model choice ('cheapest, 1K only' vs 'best, for hard tasks'), and a hard gate ('Confirm with the user before calling'). The only gap is that it never names sibling alternatives such as video_generate for non-image media.

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