Skip to main content
Glama

derive_image

DestructiveIdempotent

Edit one source from referenceImages or parentTaskId; select parentImageIndex for a multi-image parent. Prompt provenance alone is not an image. Use generate_image without a source, upscale_image for dedicated processing, and batch_generate for multiple edits. Preview returns requestId and cost/readiness in preview; auto/run reuse that receipt. Run requires approval. Execution returns task/status or nextAction; resume the original receipt after interruption.

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": {
      "action": "<action>"
    },
    "name": "derive_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNoGPT pixel size; other sizes in list_models.
countNoImages, default 1; 0 keeps legacy default.
modelNoImage model from list_models; omit for default.
actionYespreview freezes inputs and quotes cost; auto checks saved spending authorization; run requires explicit user approval.
promptNoRequired image instructions.
qualityNoGPT quality affects the quote; default auto. See list_models. Image 2 forwards other values unchanged.
promptIdNoOptional source prompt provenance; does not supply an original image.
requestIdNoOriginal preview receipt for auto/run; reuse it after interruption, without re-previewing.
frameCountNoGIF 2–16 frames; default 9. Rate: pricing.gifFramePoints/frame.
deliveryModeNonative returns previews and original links; links returns original links; metadata omits image delivery.
outputFormatNoGPT supports WebP; 2.6 adds GIF/SVG. Default png.
parentTaskIdNoCompleted owned task supplying the original image; alternative to referenceImages.
thinkingLevelNoGemini reasoning; see list_models.
derivationTypeNoLineage label, e.g. variant, edit, change-model or change-size.
frameDurationMsNoGIF frame ms: 20–2000; default 200. Timing does not change price.
promptExampleIdNoOptional source example provenance; does not supply an original image.
referenceImagesNoUp to 8 images; preview freezes bytes.
parentImageIndexNoZero-based source image index; required when the parent has multiple images.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changed
    • changedInput schema / properties / count / description
      Previous value: -"Image count; default 1, maximum 16. Zero retains the legacy default."New value: +"Images, default 1; 0 keeps legacy default."
    • addedInput schema / properties / frameCount
      Added value: +{
      +  "description": "GIF 2–16 frames; default 9. Rate: pricing.gifFramePoints/frame.",
      +  "type": "integer"
      +}
    • addedInput schema / properties / frameDurationMs
      Added value: +{
      +  "description": "GIF frame ms: 20–2000; default 200. Timing does not change price.",
      +  "type": "integer"
      +}
    • changedInput schema / properties / model / description
      Previous value: -"Public image model ID from list_models; omit for the configured recommendation."New value: +"Image model from list_models; omit for default."
    • changedInput schema / properties / outputFormat / description
      Previous value: -"Original image format; default png."New value: +"GPT supports WebP; 2.6 adds GIF/SVG. Default png."
    • changedInput schema / properties / outputFormat / enum
      Previous value: -[
      -  "jpeg",
      -  "png"
      -]New value: +[
      +  "jpeg",
      +  "png",
      +  "webp",
      +  "gif",
      +  "svg"
      +]
    • changedInput schema / properties / prompt / description
      Previous value: -"Image instructions; required for a fresh preview."New value: +"Required image instructions."
    • changedInput schema / properties / quality / description
      Previous value: -"GPT: auto (default), low, medium, high; 2.5 Sunburst/Flare also xhigh, max; affects the quote. Others: list_models qualities."New value: +"GPT quality affects the quote; default auto. See list_models. Image 2 forwards other values unchanged."
    • changedInput schema / properties / referenceImages / description
      Previous value: -"Up to 8 source images; preview freezes their bytes. Use derive_image for editing."New value: +"Up to 8 images; preview freezes bytes."
    • changedInput schema / properties / referenceImages / items / description
      Previous value: -"Public image URL or image data URL."New value: +"Public URL or image data URL."
    • changedInput schema / properties / size / description
      Previous value: -"GPT: pixel size e.g. 3840x2160. Others: list_models sizes."New value: +"GPT pixel size; other sizes in list_models."
    • changedInput schema / properties / thinkingLevel / description
      Previous value: -"Gemini reasoning level; supported values and price multipliers come from list_models."New value: +"Gemini reasoning; see list_models."
  2. Changed2 schema fields changed
    • changedInput schema / properties / quality / description
      Previous value: -"Supported quality tier from list_models; affects the quote."New value: +"GPT: auto (default), low, medium, high; 2.5 Sunburst/Flare also xhigh, max; affects the quote. Others: list_models qualities."
    • changedInput schema / properties / size / description
      Previous value: -"Supported aspect ratio from list_models, e.g. 1:1."New value: +"GPT: pixel size e.g. 3840x2160. Others: list_models sizes."
  3. Changed17 schema fields changed
    • addedInput schema / properties / action / description
      Added value: +"preview freezes inputs and quotes cost; auto checks saved spending authorization; run requires explicit user approval."
    • addedInput schema / properties / count / description
      Added value: +"Image count; default 1, maximum 16. Zero retains the legacy default."
    • addedInput schema / properties / deliveryMode / description
      Added value: +"native returns previews and original links; links returns original links; metadata omits image delivery."
    • addedInput schema / properties / derivationType / description
      Added value: +"Lineage label, e.g. variant, edit, change-model or change-size."
    • addedInput schema / properties / model / description
      Added value: +"Public image model ID from list_models; omit for the configured recommendation."
    • addedInput schema / properties / outputFormat / description
      Added value: +"Original image format; default png."
    • changedInput schema / properties / parentImageIndex / description
      Previous value: -"Zero-based; required for multiple images."New value: +"Zero-based source image index; required when the parent has multiple images."
    • addedInput schema / properties / parentTaskId / description
      Added value: +"Completed owned task supplying the original image; alternative to referenceImages."
    • addedInput schema / properties / prompt / description
      Added value: +"Image instructions; required for a fresh preview."
    • addedInput schema / properties / promptExampleId / description
      Added value: +"Optional source example provenance; does not supply an original image."
    • addedInput schema / properties / promptId / description
      Added value: +"Optional source prompt provenance; does not supply an original image."
    • addedInput schema / properties / quality / description
      Added value: +"Supported quality tier from list_models; affects the quote."
    • changedInput schema / properties / referenceImages / description
      Previous value: -"URL/data URL."New value: +"Up to 8 source images; preview freezes their bytes. Use derive_image for editing."
    • addedInput schema / properties / referenceImages / items / description
      Added value: +"Public image URL or image data URL."
    • addedInput schema / properties / requestId / description
      Added value: +"Original preview receipt for auto/run; reuse it after interruption, without re-previewing."
    • changedInput schema / properties / size / description
      Previous value: -"Ratio."New value: +"Supported aspect ratio from list_models, e.g. 1:1."
    • changedInput schema / properties / thinkingLevel / description
      Previous value: -"Gemini thinking; extended=高级模式."New value: +"Gemini reasoning level; supported values and price multipliers come from list_models."
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag a destructive, idempotent write, and the description adds real behavioral context beyond them: preview freezes inputs and quotes cost, auto consumes saved spending authorization, run needs explicit approval, and an interrupted run should reuse the original requestId rather than re-previewing. It also discloses the return shape ('task/status or nextAction'), which is not derivable from annotations.

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?

Six dense sentences, front-loaded with the source rule, then alternatives, then the action lifecycle — every sentence carries information and nothing is repeated. The telegraphic phrasing ('auto/run reuse that receipt') costs a little readability, which keeps it off a 5.

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?

For an 18-parameter, non-idempotent-looking mutation with no output schema, the description covers the essentials: source requirement, mode selection, approval gate, interruption recovery, and a sketch of the return value. Minor gaps remain around delivery/format outcomes, but those are documented in the schema.

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 is 3; the description earns an extra point by framing referenceImages, parentTaskId and parentImageIndex as a mutually exclusive source-selection rule, and by warning that promptId/promptExampleId are provenance only. It does not otherwise add syntax detail beyond what the schema already states per field.

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 opening sentence states a specific verb and resource — edit one source taken from referenceImages or parentTaskId — and immediately names the sibling alternatives (generate_image without a source, upscale_image, batch_generate). An agent can distinguish this tool from every sibling 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 Guidelines5/5

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

Explicit routing is given both for siblings ('Use generate_image without a source, upscale_image for dedicated processing, and batch_generate for multiple edits') and for the action modes (preview freezes and quotes, auto checks spending authorization, run requires approval). The when-not case ('prompt provenance alone is not an image') is also spelled out.

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