Skip to main content
Glama

edit_image

Edit or generate images from 1-8 reference images and a text prompt. Use it to keep a consistent style across assets, modify elements, combine images, or target changes with an optional mask.

Instructions

Create a new image that is guided by one or more existing images (1-8 reference files) plus a text prompt, save it to the project's generated-assets directory, and return a preview. The model sees every reference image and the prompt together, so use this tool whenever the result must stay consistent with images you already have: to keep one visual style across a whole set of assets, pass the same brand-board or style-reference image in reference_paths for every asset and describe the new subject in the prompt (for example 'In the style of the reference: a hero illustration of a lighthouse at dawn'). Also use it to modify an image (change colours, add or remove elements, restyle it) or to combine several images into one. For a brand-new image with no reference, use generate_image. MASKING: mask_path is an optional PNG the same size as the first reference whose transparent pixels mark the region to change. Masking is prompt-guided rather than pixel-exact: the model treats the mask as strong guidance and may adjust areas near the edge, so always describe the desired change in the prompt too. Paths may be absolute or relative to the server's working directory. SIZE: pass a preset name or explicit WIDTHxHEIGHT. Presets: 'square' (1024x1024), 'landscape' (1536x1024), 'portrait' (1024x1536), 'hero' (1920x1088), 'banner' (1536x512), 'auto' (model picks). Explicit sizes are rounded to the nearest multiple of 16 (minimum 256); the aspect ratio must be between 1:3 and 3:1 and neither side may exceed 3840. The result text reports the size actually produced, so check it if the exact pixel size matters. BACKGROUND: 'transparent' produces an alpha channel and requires output_format 'png' or 'webp' (never 'jpeg'); use it for logos, icons and cut-out illustrations. QUALITY: 'low' is fast and cheap (good for drafts and iteration), 'high' is slow (can take over a minute) and detailed; 'auto' lets the model choose. RETURNS: for each image, a text block with the absolute file path, final width x height, model, quality and the path of a .json sidecar holding the prompt and settings, followed by a small JPEG preview (longest side 512px) so you can inspect the result. The full-resolution file is already on disk; reference it by the returned path (for example as a site asset).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNoPreset name (square, landscape, portrait, hero, banner, auto) or WIDTHxHEIGHT.square
promptYesWhat the new image should show; describe how the references should influence it.
qualityNoauto, low (fast draft), medium, or high (slow, detailed).auto
filenameNoOptional file name without extension. Defaults to a slug of the prompt plus a timestamp. Never overwrites.
mask_pathNoOptional PNG mask for the first reference; transparent pixels mark the area to change.
backgroundNoauto, opaque, or transparent (transparent requires png or webp).auto
output_formatNoFile format: png, jpeg, or webp.png
reference_pathsYes1-8 image files (png, jpeg, or webp) that guide the result.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and succeeds impressively. It discloses masking is 'prompt-guided rather than pixel-exact' with edge adjustment, size rounding to multiples of 16 with aspect-ratio and 3840 limits, background/output-format coupling ('transparent... requires output_format png or webp'), quality latency tradeoffs ('high... can take over a minute'), and that the full-resolution file is already on disk to be referenced by the returned path.

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 long, but the tool's complexity (8 params, masking nuance, size constraints, format coupling) justifies the length. It is well-sectioned with labeled blocks (MASKING, SIZE, BACKGROUND, QUALITY, RETURNS) and front-loads the core purpose and use cases before parameter details. Minor redundancy exists with schema fields like the non-overwrite filename behavior, so it is not zero-waste, but it is efficiently organized for its scope.

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?

Given no annotations and no output schema, this description covers everything an agent needs to invoke correctly: return format (absolute path, final dimensions, model, quality, .json sidecar, JPEG preview), size behavior verification ('check it if the exact pixel size matters'), mask semantics, format limits, and path resolution. For an 8-parameter generative tool, the completeness is exceptional.

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 baseline is 3. The description adds real value beyond the schema: exact preset dimensions ('square' 1024x1024, 'hero' 1920x1088), rounding/constraint rules for explicit sizes, the mask being 'the same size as the first reference,' and the quality speed implications. This meaningfully deepens the agent's understanding without repeating schema boilerplate.

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 opens with a specific verb and resource: 'Create a new image that is guided by one or more existing images (1-8 reference files) plus a text prompt, save it... and return a preview.' It clearly distinguishes itself from the sibling generate_image by centering on reference-guided generation and explicitly framing style-consistency and image-modification use cases.

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?

The description gives explicit when-to-use guidance: 'use this tool whenever the result must stay consistent with images you already have,' including style batching, modification, and combining images. It also names the exclusion condition and alternative: 'For a brand-new image with no reference, use generate_image.' This is model-level routing with nothing left to inference.

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/mostmark/openai-image-mcp'

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