Skip to main content
Glama

image.generate_for_edit

[paid: $0.06] Generate an image from a text prompt (google/nano-banana-2.1) sized for editing. Returns JSON {images:[{url, asset_key, download_url?, width, height}], price, next} plus a preview; images are stored in this workspace, never provider links, and a result with no download_url says why in download_url_unavailable. Refuses: VALIDATION_ERROR on an empty prompt (describe the image), SIMPLER_IMAGE_PROMPT_REFUSED names the label (sexual, minor, real_person or other_unsafe): rewrite the prompt without it, for example no real person's name or likeness; SIMPLER_IMAGE_PROMPT_CHECK_UNAVAILABLE (the safety check is down, nothing charged: retry later); SIMPLER_IMAGE_OUTPUT_FLAGGED (the output failed the content check and was refunded: change the prompt); SIMPLER_IMAGE_OUTPUT_SCAN_UNAVAILABLE (outputs cannot be checked right now, nothing charged: retry later), INSUFFICIENT_CREDITS (add credits). SIMPLER_EDIT_RESULT_UNDELIVERED means the charge was refunded: retry. NEXT: pass images[0].asset_key as image_asset_key to image.inpaint, image.upscale or image.style_transfer.

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": "image.generate_for_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYesFull image description.
image_sizeNoOlder size names; when sent, they win over destination.
destinationNoWhere it will be used, which sets the shape: ig_post 4:5 (the default), story_reel 9:16, square 1:1, flyer_a4 (A4 portrait), web_banner 16:9.
request_refNoOptional idempotency key (1-64 chars: letters, digits, . _ : -). Retrying with the same request_ref and the same arguments within 24 hours returns the first result at $0 with replayed: true; the same request_ref with different arguments is refused (SIMPLER_IMAGE_REQUEST_REF_CONFLICT), and so is a retry whose first result was deleted since (SIMPLER_IMAGE_REQUEST_REF_RESULT_DELETED): send a new request_ref to run it again.
preview_formatNoPreview block after the JSON, at most 384px on the long edge and never charged: png, jpeg or none. Left out, a PNG result gets a png preview and a JPEG or WebP result a jpeg one. A result with no preview says why in preview_unavailable.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / destination
      Added value: +{
      +  "description": "Where it will be used, which sets the shape: ig_post 4:5 (the default), story_reel 9:16, square 1:1, flyer_a4 (A4 portrait), web_banner 16:9.",
      +  "enum": [
      +    "ig_post",
      +    "story_reel",
      +    "square",
      +    "flyer_a4",
      +    "web_banner"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / image_size / description
      Added value: +"Older size names; when sent, they win over destination."
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

The description discloses the $0.06 charge, the exact return shape, workspace storage rather than provider links, and explains download_url_unavailable. It also names many refusal codes and tells the agent what to do for each, including when nothing was charged or when a charge was refunded.

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?

The description is dense but front-loads cost, action, and return shape, then handles refusals and next steps. The long run-on error-code list is useful but could be more scannable.

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?

With no output schema, the description fully specifies the JSON response and preview behavior. It also supplies the missing behavioral context for a paid generation tool: charging, storage, refusal handling, refunds, and how to continue into editing tools.

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 prompt, image_size, destination, request_ref, and preview_format are already well documented in the schema. The description adds some operational context, such as empty-prompt refusal and using the output asset_key, but it does not materially deepen parameter meaning beyond the schema.

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 description states a specific verb and resource: generate an image from a text prompt with a named model, explicitly sized for editing. It distinguishes this from plain generation by its editing-oriented sizing and by routing the produced asset to image.inpaint, upscale, and style_transfer.

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?

It gives clear workflow guidance: use the result's images[0].asset_key with image.inpaint, image.upscale, or image.style_transfer. It does not explicitly contrast this tool with the sibling image.generate for non-edit use, so the when-not guidance is implied rather than stated.

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.

Resources