Skip to main content
Glama
openai-image-mcp-secure

openai-image-mcp-secure

by leiting684

edit_image

Revises an existing image or combines several references, then saves the result as a numbered version while keeping earlier versions available.

Instructions

Revises an existing image, or combines several as references, and saves the result.

This is the tool for follow-up changes ("make it black", "add sunglasses", "remove the
background"): pass the saved path of the latest version from the previous result. The
result is saved as the next numbered version, so earlier versions stay available.

Args:
    request_id: Optional client-generated UUID. Reuse on retry to prevent a second paid request.
    prompt: The change to make, and what must stay the same, for example "Make the cat's
        fur black. Keep the pose, background, and lighting unchanged." For several
        references, describe the new image to build from them.
    image_paths: Full paths to one or more local PNG, JPEG, or WebP files. For a revision,
        the single most recent version.
    mask_path: Optional PNG whose transparent areas mark where to edit the first image.
    size: "auto" or WIDTHxHEIGHT, with the same rules as generate_image.
    quality: "low" for fast drafts up to "max".
    background: "transparent" needs output_format "png" or "webp".
    output_format: File format of the saved image.
    n: Number of results, 1 to 4. Each one is billed.
    model: A model ID for this request only. Leave empty to use the user's default.
    open_after: Open each saved image in the user's default image viewer. Set it when the
        user asks to see or open the result, when the client cannot display inline previews.
    input_fidelity: Use "auto" to omit the API parameter. GPT Image 1.5 accepts low or high,
        1 mini accepts low, and the verified 2.x models require auto here.

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>",
      "image_paths": "<image_paths>"
    },
    "name": "edit_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
nNo
sizeNoauto
modelNo
promptYes
qualityNoauto
mask_pathNo
backgroundNoauto
open_afterNo
request_idNo
image_pathsYes
output_formatNopng
input_fidelityNoauto

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare that this is a non-destructive open-world write, but the description adds several facts the annotations cannot: results are billed per image (n up to 4, each billed), request_id reuse prevents a duplicate paid request, and output is saved as the next numbered version so earlier versions persist. It also documents the background/output_format compatibility constraint and model-specific input_fidelity rules, which are real behavioral gotchas.

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?

Purpose and when-to-use are front-loaded in two short sentences before the parameter list, and each Args line is one dense sentence with no filler. The example prompts and quotes make abstract parameters concrete rather than padding the text.

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 a 12-parameter mutation tool with no output schema and zero schema descriptions, the definition covers nearly everything an agent needs, including cost and versioning implications. The remaining gap is the return shape: it implies a saved path is returned (referenced as the input for the next edit) but never states the result fields, which matters since no output schema documents them. The 'same rules as generate_image' cross-reference for size also requires the agent to hold context from the sibling.

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?

Schema description coverage is 0%, so the description carries the full parameter burden and does so for all 12: request_id semantics on retry, prompt guidance with a concrete example of stating what must stay unchanged, accepted file types and 'single most recent version' for image_paths, mask transparency semantics, the background/output_format dependency, per-image billing for n, per-request model override, and the model-gated input_fidelity values.

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 first sentence gives a specific verb and scope: revises an existing image or combines several as references, then saves the result. The second sentence positions it against new-image generation by framing it as the tool for follow-up changes, so an agent can separate it from generate_image without opening either 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?

It states a clear usage context (follow-up edits like 'make it black' or 'remove the background') and an explicit prerequisite: pass the saved path of the latest version from the previous result. It also gives conditional guidance for open_after (when the user asks to see the result or the client cannot display inline previews). It stops short of explicitly naming generate_image as the alternative for brand-new images, so no hard exclusion is stated.

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