Skip to main content
Glama

Generate image

generate_image

Generate an image from a prompt, or edit one when image_url is given. Default model: image/nano-banana-2. image_url is the image to edit; image_urls are extra references for style, identity or composition; character_ids adds saved Characters. num_images (1-4) makes several images of the same request, each charged as one image. Returns a job; check_job returns the permanent image URLs once it is completed. Submitting charges credits, refunded automatically if the job fails; estimate_generation prices one image without charging.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNoLegacy alias of aspect_ratio.
modelNoImage model ID. Default image/nano-banana-2.
extrasNoModel-specific parameters as listed by get_model_params. They are merged with the top-level fields.
promptYesWhat to generate, or the edit instructions when image_url is given.
force_newNoAn identical request submitted in the last 10 minutes returns that job without charging again; true generates it again.
image_urlNoSource image to edit (https URL).
image_urlsNoReference images (https URLs).
num_imagesNoNumber of images to generate (1-4). Each image is its own job, charged one image's price and refunded on its own if it fails; they share one job_id and the card shows them side by side.
skills_usedNoOptional workflow analytics: names of the skills (or skill/reference paths) followed for this call. Stored with generation jobs only. Never include private data, local paths or media URLs.
aspect_ratioNoOutput shape such as 16:9; allowed values per model in get_model_params.
character_idsNoSaved Characters for this shot, in order; a one-item array for one Character. Use list_characters for names and ids, then use the exact saved names in prompt. The server adds each identity description and reference image after existing references and states their Image N numbers; do not guess those numbers. All references count toward the model limit; unsupported requests fail before charging.
budget_projectNoOptional budget project this generation's cost counts toward, for tracking spend per client or job. Pass its slug; an id or the exact display name also works. Create one with create_budget_project and find slugs with list_budget_projects. An unknown project never stops the generation: it runs without one, and the result warns how to add it with assign_to_budget_project.
agentic_promptingNoOptional prompt rewrite for the selected model. Omit it (default) or set false to preserve the user's wording; set true only when the user wants a model-specific rewrite. Adds a few seconds and costs nothing extra; the result returns the rewritten prompt (and original_prompt), or a warning when the original was kept. Selected Character identity context is appended unchanged either way.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations mark this as a non-read-only, open-world, non-idempotent write, and the description goes beyond that by disclosing that submitting charges credits, that failed jobs are refunded automatically, and that the call returns a job rather than finished images whose URLs come from check_job. This is the billing and lifecycle context an agent needs before spending credits. It stops short of stating rate limits or per-model constraints.

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-loads the core generate/edit distinction in the first sentence, then groups parameter notes, then billing and return behavior. Dense but nearly every clause carries information. It is on the long side for a single prose block, but no sentence is clearly filler.

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?

With 13 parameters, an open-world write profile, and no output schema, the description carries the important burdens well: it explains the job-return pattern, where permanent URLs come from, and the charging/refund model. Less central parameters (extras, skills_used, budget_project, agentic_prompting, size) are left entirely to the schema, which is acceptable given full schema coverage.

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 the baseline would be 3, but the description adds real interpretation: the image_url versus image_urls split (edit source vs style/identity/composition references), that num_images produces several images each charged as one image, and that character_ids injects saved Characters. Those clarifications help an agent choose parameters rather than merely read them.

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 an image from a prompt') and immediately branches to the edit mode when image_url is given, so the two operations this tool performs are unambiguous. It also names the related siblings check_job and estimate_generation, letting an agent place the tool in the workflow without opening a schema.

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?

Gives explicit conditional guidance: image_url selects edit mode, image_urls adds references, character_ids adds saved Characters, and estimate_generation should be used to price without charging. It does not say when to prefer upscale_image or render_html_image over this tool, so it stops short of full alternative coverage.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.