Skip to main content
Glama

generate_image

Generate or edit images from natural language instructions, using Amazon listing compliance rules and character-consistent references to produce on-brand product visuals.

Instructions

Catalog entry. Runs in your Kuudo deployment, not here. Generate or edit images with Google Gemini (Nano Banana) from natural language instructions. For OpenAI gpt-image-2, use the sibling generate_openai_image tool. For Amazon / Seller Central listing images, FIRST read the skill://amazon-product-image/SKILL.md resource (via read_resource) for the marketplace image-compliance rules, then generate/audit against them. ## CHARACTER CONSISTENCY Use public image handles for character-consistent image generation: generate_image( input_images=["agent-iris://images/img_12"], mode="generate", prompt="PRESERVE EXACTLY: character's facial features. NEW: Professional headshot...", model="gemini-3-pro-image" ) Explicit generate mode uses the image handle as conditioning rather than an edit source. ## EDITING AN EXISTING IMAGE For local bytes, upload with POST /images first, then pass the returned handle. For a public hosted image, pass the HTTPS URL directly: generate_image( input_images=["https://example.com/source.jpg"], mode="edit", prompt="Change the background to a beach sunset" ) ## ITERATING ON A RESULT (high-fidelity chained edit) — PREFERRED Every generate/edit response returns an interaction_id. Pass it back to refine the SAME image while preserving the rest of the composition — no need to re-send the source. This beats re-editing from bytes for edit fidelity: generate_image( interaction_id="v1_Chd...", # from the previous response prompt="Recolor the mug to beige. Change nothing else." ) TTL: ~55 days (paid) / 1 day (free). ## COMPOSITING (Person from image A into scene B) Use multiple references with generate mode: generate_image( input_images=["agent-iris://images/img_12", "gemini://files/beachRef"], mode="generate", prompt="Place character from image 1 into the beach scene from image 2..." ) ## OPERATION PRESETS Use operation="icon", "pattern", "diagram", "storyboard", or "photo_repair" for strict defaults around model, aspect ratio, and prompt framing. ## Mode Auto-Detection: - interaction_id → EDIT mode - operation="photo_repair" → EDIT mode - operation="icon"/"pattern"/"diagram"/"storyboard" → GENERATE mode - operation="general" with one input image → EDIT mode - Multiple input images or pure prompt → GENERATE mode Returns both MCP image content blocks and structured JSON with metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoRequested image count (model may return fewer).
modeNoOperation mode: 'auto' (default), 'generate', or 'edit'. AUTO BEHAVIOR: interaction_id or photo_repair → edit mode; generation presets → generate mode; one general input image → edit mode. USE 'generate' FOR: Creating new images with character reference, style transfer, conditioning. USE 'edit' FOR: Modifying a specific existing image (change background, outfit, add text). You can override auto-detection by explicitly setting mode='generate' or mode='edit'.auto
modelNoModel selection. gemini-3.1-flash-image: Nano Banana 2 (DEFAULT), supports grounding, 14 aspect ratios, and 0.5K-4K output. gemini-3-pro-image: Nano Banana Pro, professional asset production, grounding, 14 total references, 1K-4K output. gemini-2.5-flash-image: Original Nano Banana — fast drafts ($0.039/image), no grounding support. Legacy -preview aliases are accepted and normalized to current model IDs.
promptYesClear, detailed image prompt. Include subject, composition, action, location, style, and any text to render. Add 'Square image' or '16:9' in the text to influence aspect ratio.
operationNoStrict operation preset: general, icon, pattern, diagram, storyboard, or photo_repair.general
resolutionNoOptional resolution. gemini-3.1-flash-image supports 0.5K, 1K, 2K, and 4K. gemini-3-pro-image supports 1K, 2K, and 4K. gemini-2.5-flash-image supports 1K only.
output_nameNoOptional base name for output file(s). If provided, files will be named '<output_name>.png' (or '<output_name>_1.png', '<output_name>_2.png' for multiple images). Use descriptive names like 'brand-linkedin-headshot' or 'product-hero-banner'. If not provided, defaults to timestamped names like 'gen_20251217_120000_1_1_abc123.png'.
aspect_ratioNoOptional output aspect ratio. Standard: 1:1 (square), 3:4, 4:3, 2:3, 3:2, 4:5, 5:4, 9:16 (portrait), 16:9 (landscape), 21:9 (ultra-wide). New in Nano Banana 2: 1:4 (tall strip), 4:1 (wide banner), 1:8 (ultra-tall), 8:1 (ultra-wide).
input_imagesNoImages for editing or conditioning. Accepts agent-iris://images/{image_id}, gemini://files/{name}, and http(s) image URLs. Hosted URLs are fetched server-side inside this authenticated tool call; upload local bytes with POST /images when a durable server handle is needed.
use_groundingNoEnable Google Search grounding for real-time data retrieval before generation. REQUIRED for infographics, charts, current events, statistics, or any real-world data. IMPORTANT: Grounding works with 'gemini-3.1-flash-image' (default) and 'gemini-3-pro-image'. Default: False.
interaction_idNoInteractions API id from a PRIOR generate/edit call (e.g., 'v1_Chd...'). PREFERRED way to iterate on an image: pass it to chain a high-fidelity edit that preserves the rest of the composition (no need to re-send the source image). Implies edit mode. TTL ~55 days (paid) / 1 day (free).
thinking_levelNoOptional thinking level for Gemini 3 image models. Allowed values: low or high. Use high for complex compositions, text-heavy images, or unusual prompts. Leave unset for the model default.
include_previewNoWhether to ALSO embed the inline base64 thumbnail preview block(s). Default false (link-first): the response is the text summary + signed download URLs (including a signed thumbnail URL) + structured metadata, with no base64 — saving context tokens. Set true to additionally embed the inline thumbnail for a quick interactive visual check on a single image. Thumbnails are always stored server-side and reachable via the signed thumbnail URL regardless of this flag.
negative_promptNoThings to avoid (style, objects, text).
system_instructionNoOptional system tone/style guidance.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and delivers: it discloses that the tool runs in the Kuudo deployment, defines mode auto-detection behavior, notes interaction_id TTL (~55 days paid/1 day free), explains handle-as-conditioning vs edit-source semantics, requires POST /images for local bytes, and states the return format. It omits rate limits, failure behavior, and storage/cleanup details, so it is strong but not exhaustive.

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?

Long, but structured with section headers and code blocks so each block earns its place; overview and sibling routing are front-loaded. There is minor redundancy with the schema's mode auto-detection text and the cryptic 'Catalog entry' opener, but the length is justified by the tool's 15 parameters and multiple workflows.

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?

No output schema exists, yet the description states that responses include MCP image content blocks plus structured JSON metadata, covers handle types, upload flow, iteration workflow, presets, and the Amazon compliance prerequisite. Minor gaps remain in exact metadata fields, error semantics, and rate limits, so it falls just short of fully complete for so complex a tool.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds meaning beyond the schema through executable examples: character-consistency conditioning with agent-iris:// handles, HTTPS URL editing, interaction_id-only iteration, and multi-reference compositing, plus operation preset semantics. These clarify how mode, input_images, interaction_id, and prompt interact.

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 and resource: 'Generate or edit images with Google Gemini (Nano Banana) from natural language instructions.' It also names the sibling it is not, saying 'For OpenAI gpt-image-2, use the sibling generate_openai_image tool,' so an agent can route correctly without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes to generate_openai_image for OpenAI, prescribes reading skill://amazon-product-image/SKILL.md before Amazon/Seller Central work, marks the interaction_id chained edit as 'PREFERRED', and lays out mode auto-detection rules with explicit override guidance. This is explicit when/when-not/alternatives guidance.

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

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/KuudoAI/amazon-agent-iris-mcp'

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