Skip to main content
Glama

edit_image

Edit existing images using text prompts. Supports inpainting with optional mask and preserves unchanged pixels for sequential refinements.

Instructions

Edit an existing image using OpenAI gpt-image-2's /images/edits endpoint.

This is the right tool for:

  • Image-to-image refinement (OpenAI's answer to reference images)

  • Inpainting with a mask (paint over regions while preserving the rest)

  • Sequential/cumulative edits that preserve unchanged pixels

  • Brand-accurate modifications to existing images

Key features of gpt-image-2 editing:

  • input_fidelity='high' (default) keeps unchanged pixels constant — critical for multi-step refinement where each edit should build on the last without drift.

  • Full control over quality, background, output_format, and compression.

  • Supports optional PNG mask (transparent pixels are the edit region).

Typical workflow:

  1. Generate or obtain a base image (path on disk)

  2. Call edit_image with prompt='change the sky to sunset'

  3. Take the output path, call edit_image again with next instruction

  4. Repeat — each step preserves pixels outside the described change

Args: params: Edit parameters including prompt, image_path, and options.

Returns: Formatted response with edited image path and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Discloses key behavioral traits: uses /images/edits endpoint, default high input fidelity to preserve pixels, mask support, sequential workflow. Annotations (readOnlyHint=false, destructiveHint=false) are consistent; description adds context about mutable but non-destructive behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with bullet points and sections (key features, typical workflow). No fluff; each sentence adds valuable information. Appropriate length given tool complexity.

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?

Covers use cases, workflow, and key features comprehensively. With an output schema present, return value explanation is unnecessary. The description is self-contained for correct invocation.

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

Parameters5/5

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

Although the tool has a single 'params' object with 0% description coverage at top level, the nested schema thoroughly documents all parameters. The description adds value by explaining key parameters like input_fidelity and mask_path in context, aiding interpretation beyond schema alone.

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 clearly states it edits existing images using OpenAI's gpt-image-2 endpoint. It lists specific use cases (image-to-image refinement, inpainting, sequential edits) that distinguish it from sibling tools like generate_image or conversational_image, which focus on generation or conversation.

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 guidance under 'This is the right tool for:' with bullet points covering refinement, inpainting, sequential edits, and brand modifications. It implies not for from-scratch generation (handled by generate_image). The workflow description further clarifies when to use.

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

Install Server

Other Tools

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/michaeljabbour/imagen-mcp'

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