Skip to main content
Glama

Edit image

edit_image

Edit images with multipart uploads, JSON image URLs, or JSON arrays for supported GPT Image models.

Instructions

Edits an image using multipart image uploads, JSON image URLs, or the official JSON images array for supported GPT Image models.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
maskNoOptional JSON mask reference for image edits. Provide exactly one of image_url or file_id. Multipar…
sizeNo
userNo
asyncNoReturn a task before the edited image is ready for models that support public async execution.
modelYesModel to use for image edits. Send this explicitly.
imagesNoOfficial JSON image references for image edits. Provide exactly one of image_url or file_id for eac…
promptYes
qualityNo
image_urlNoSingle source image URL. Kept for TokenLab compatibility; use images for the official JSON shape.
backgroundNo
image_urlsNoMultiple source image URLs. GPT Image edits accept up to 16 source images; xAI Grok Imagine edit mo…
moderationNo
resolutionNo
compressionNo
aspect_ratioNo
output_formatNo
response_formatNo
output_compressionNo
X-TokenLab-Delivery-PolicyNoPer-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Veri…

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.6.24
    • addedInput schema / properties / X-TokenLab-Delivery-Policy
      Added value: +{
      +  "description": "Per-request Delivery policy. Overrides the API key and Workspace defaults. Auto tries TokenLab Veri…",
      +  "enum": [
      +    "auto",
      +    "verified",
      +    "official"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / image_urls / description
      Previous value: -"Multiple source image URLs. GPT Image edits accept up to 16 source images; xAI Grok Imagine edit models accept at most 3 source images."New value: +"Multiple source image URLs. GPT Image edits accept up to 16 source images; xAI Grok Imagine edit mo…"
    • changedInput schema / properties / images / description
      Previous value: -"Official JSON image references for image edits. Provide exactly one of image_url or file_id for each item. GPT Image edits accept up to 16 source images; xAI Grok Imagine edit models accept at most 3 source images."New value: +"Official JSON image references for image edits. Provide exactly one of image_url or file_id for eac…"
    • changedInput schema / properties / mask / description
      Previous value: -"Optional JSON mask reference for image edits. Provide exactly one of image_url or file_id. Multipart requests can also send mask as a file part."New value: +"Optional JSON mask reference for image edits. Provide exactly one of image_url or file_id. Multipar…"
    • changedInput schema / properties / mask / properties / image_url / description
      Previous value: -"Source mask image URL. Public http/https URLs and compatible data URLs are supported by the runtime validation path."New value: +"Source mask image URL. Public http/https URLs and compatible data URLs are supported by the runtime…"
  2. Changed13 schema fields changedv0.6.4
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties / images / items / additionalProperties
      Added value: +false
    • removedInput schema / properties / images / items / allOf
      Removed value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "file_id": {
      -        "description": "A file id returned by TokenLab /v1/files and bound to the same image-edit configuration.",
      -        "type": "string"
      -      },
      -      "image_url": {
      -        "format": "uri",
      -        "type": "string"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "oneOf": [
      -      {},
      -      {}
      -    ]
      -  }
      -]
    • addedInput schema / properties / images / items / oneOf
      Added value: +[
      +  {},
      +  {}
      +]
    • addedInput schema / properties / images / items / properties
      Added value: +{
      +  "file_id": {
      +    "description": "A file id returned by TokenLab /v1/files and bound to the same image-edit configuration.",
      +    "type": "string"
      +  },
      +  "image_url": {
      +    "format": "uri",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / images / items / type
      Added value: +"object"
    • addedInput schema / properties / mask / additionalProperties
      Added value: +false
    • removedInput schema / properties / mask / allOf
      Removed value: -[
      -  {
      -    "additionalProperties": false,
      -    "properties": {
      -      "file_id": {
      -        "description": "A file id returned by TokenLab /v1/files and bound to the same image-edit configuration.",
      -        "type": "string"
      -      },
      -      "image_url": {
      -        "description": "Source mask image URL. Public http/https URLs and compatible data URLs are supported by the runtime validation path.",
      -        "format": "uri",
      -        "type": "string"
      -      }
      -    },
      -    "type": "object"
      -  },
      -  {
      -    "oneOf": [
      -      {},
      -      {}
      -    ]
      -  }
      -]
    • addedInput schema / properties / mask / oneOf
      Added value: +[
      +  {
      +    "required": [
      +      "image_url"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "file_id"
      +    ]
      +  }
      +]
    • addedInput schema / properties / mask / properties
      Added value: +{
      +  "file_id": {
      +    "description": "A file id returned by TokenLab /v1/files and bound to the same image-edit configuration.",
      +    "type": "string"
      +  },
      +  "image_url": {
      +    "description": "Source mask image URL. Public http/https URLs and compatible data URLs are supported by the runtime validation path.",
      +    "format": "uri",
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / mask / type
      Added value: +"object"
    • removedInput schema / properties / n / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / stream
      Removed value: -{
      -  "const": false,
      -  "description": "Image streaming is not exposed through MCP tool calls; omit stream or set it to false.",
      -  "type": "boolean"
      -}
  3. Addedv0.3.1

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false, idempotentHint=false and openWorldHint=true, so the mutation and external-call profile is covered structurally. The description adds the supported input modes (multipart upload, JSON URLs, images array) and a model restriction, but says nothing about async behavior, delivery policy, or what the edit returns.

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?

A single front-loaded sentence with no filler, and the input-mode enumeration is useful. It is efficient, though for a 20-parameter tool it is arguably thin rather than bloated.

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

Completeness2/5

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

For a complex 20-parameter, nested-schema, no-output-schema mutation tool, one sentence is not enough. The description does not cover the image input precedence (images vs image_urls vs image_url), the mask parameter, or the async/model-specific constraints.

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 only 35% across 20 parameters, so the schema does not carry the load. The description partially compensates by naming the three image-input shapes, which maps to image_url, image_urls, images and mask, but leaves the other parameters (size, quality, response_format, delivery policy, etc.) unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Edits an image') and names the three supported input modes, which is more than a tautology. However, it never distinguishes this tool from close siblings like edit_image_file or create_image, leaving the agent to guess which entry point applies.

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

Usage Guidelines2/5

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

There is no when-to-use/when-not guidance and no alternative tool is named. The only implied constraint is 'for supported GPT Image models,' which narrows the model set but does not tell the agent when to pick this over edit_image_file or create_image.

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