Skip to main content
Glama

generate_image

Generate or edit images from text prompts or reference images. Runs on multiple AI models, saves results locally, and returns file paths instead of base64 data.

Instructions

生成/编辑图片(OpenAI 兼容 /images/generations,模型名透传:gpt-image-2、gemini-3-pro-image、grok-imagine-image-quality、即梦、doubao-seedream 等)。默认保存到本地并只返回文件路径(零 base64)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo可选,生成数量(部分供应商支持)。
sizeNo可选,例如 1024x1024、1536x1024。
imageNo可选,参考图(单张):公网 URL、Data URL、Base64、本地图片路径,或 @chatbox-latest(自动读取 Chatbox 最近拖入的图片)。提供后为图生图(部分模型支持)。
modelNo可选,默认取 AI_MEDIA_IMAGE_MODEL。模型名透传。
imagesNo可选,多张参考图(图生图/多模态):每项为公网 URL、Data URL、Base64、本地图片路径或 @chatbox-latest(自动取最新拖入图)。例:["D:\a.png", "https://..."]。
promptYes图片内容描述,越具体效果越好。
qualityNo可选,standard/hd/high/medium/low。
output_dirNo可选,保存目录(默认 AI_MEDIA_IMAGE_OUTPUT_DIR)。
resolutionNo可选,如 1k、2k(部分 xAI/grok 网关支持)。
auto_promptNo自动提示词增强(默认开启)。当你只上传了参考图、提示词不足 15 字时,自动套用内置'无缝融合'增强模板(光影/透视/色调一致性,解决贴图感)。false=关闭。
return_modeNopath=仅返回路径(默认);inline=返回图片数据;both=两者。注意 inline 会把 base64 带入对话上下文。
aspect_ratioNo可选,如 1:1、16:9、9:16(仅当未指定 size 时发送)。
Behavior4/5

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

With no annotations provided, the description carries the behavioral burden. It discloses key behaviors: it saves to local storage by default, returns a file path with '零 base64', supports model name passthrough, and claims both generation and editing capabilities. It does not mention cost, rate limits, or auth dependencies, but the most operationally critical side effects are stated.

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?

The description is a single dense sentence that front-loads the action, names the API compatibility and key models, then states the default output behavior. Every clause carries useful information and there is no filler, making it efficient and well-structured.

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 tool without annotations or output schema, the description covers the main decision-relevant topics: purpose, default return mode, and local saving. The remaining gaps (relationships such as size vs aspect_ratio, image vs images) are largely handled by the very detailed schema, so the calling context is nearly complete, but not fully self-contained.

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?

All parameters have descriptions in the schema (100% coverage), so the baseline is 3. The description only restates 'model name passthrough', which the 'model' property already explains. There is no additional param-level meaning added beyond what the schema already provides.

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 tool's action, '生成/编辑图片' (generate/edit images), and anchors it to the OpenAI-compatible /images/generations endpoint with examples of model names. It is a specific verb+resource that is unmistakably distinct from its sibling video and capability-inspection tools.

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

Usage Guidelines3/5

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

The text implies the usage window (image generation/editing) but does not explicitly state when to choose this tool over alternatives such as generate_video, nor does it provide exclusions, prerequisites, or 'when not to use' guidance. A clear enough scope is inferable from purpose and sibling names, but no direct routing is given.

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/wojiaopanhaoran/ai-media-mcp'

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