Skip to main content
Glama

Edit Image

edit_image

Edit images with a text instruction: change background, add or remove elements, or combine multiple images into one scene. Returns saved file path and preview.

Instructions

Edit or transform existing image(s) with a text instruction — restyle, add or remove elements, change background, or combine several images into one scene. The result is saved to disk and its absolute path is returned, along with a small inline preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoModel slug, e.g. 'google/gemini-2.5-flash-image' or 'openai/gpt-5-image'. Omit to use the configured default. Call list_models to see options.
imagesYesSource image(s): absolute file paths, file:// URLs, https:// URLs, or data: URLs. Pass several images for composition or style-transfer edits.
promptYesInstruction describing the edit, e.g. 'remove the background', 'make it night time', 'combine these two photos into one scene'.
output_dirNoDirectory to save into (absolute, or ~ for home). Defaults to the configured output directory.
filename_prefixNoShort label used in the saved filename, e.g. 'hero-banner'. Sanitized to letters, digits, dashes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
failedYesError messages for variations that failed
imagesYes
Behavior4/5

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

Beyond annotations (readOnlyHint=false, etc.), the description adds that the result is saved to disk and absolute path is returned with a preview. It also clarifies that multiple images can be passed for composition, adding behavioral context.

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?

Two sentences: first describes what the tool does with examples, second describes the output. No wasted words, front-loaded with the key action and resource.

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 the output schema exists (implied), the description covers the output format. Parameter details are rich in the schema. The description is complete for an agent to understand when and how to use the tool, and the sibling list provides additional context.

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%, but the description adds value: examples for prompt, allowed URL types for images, default behavior for model and output_dir, and sanitization for filename_prefix. This adds meaning beyond the schema's property descriptions.

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 the verb 'edit or transform' and the resource 'existing image(s)', with specific examples like restyling, adding/removing elements, changing background, or combining images. It distinguishes itself from siblings like 'generate_image' (creates new) and 'generate_video'.

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?

The description implies use when editing existing images with a text instruction, but does not explicitly state when not to use or suggest alternatives. The sibling list helps differentiate, but the description itself lacks explicit usage boundaries.

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/legolev/mediamcp'

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