Skip to main content
Glama

generate_image

Generate images from text prompts using Gemini's image preview model. Save locally to avoid base64 token bloat, or return base64 for MCP.

Instructions

通过 OpenAI-compatible 接口调用 Gemini 的 "gemini-3-pro-image-preview" 生成图片:默认保存到本地并返回文件路径(避免 base64 导致 token 暴涨);也可用 output=image 返回 MCP image content。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes图片描述/提示词(必填)
sizeNo图片尺寸,默认 1024x1024(按你的网关/模型支持填写)
nNo生成张数,默认 1(建议 1-4)
outputNo返回格式:path(默认,保存后返回路径)或 image(返回 MCP image base64)
outDirNo保存目录(可选):相对路径以项目根目录为基准;默认 debug-output/;也可用环境变量 OPENAI_IMAGE_OUT_DIR
Behavior4/5

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

With no annotations, the description carries full burden and explains key behaviors: default saves locally to avoid token issues, can return base64, and supports environment variable for output directory. However, it lacks details on error handling, rate limits, or authentication.

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 a single sentence that is reasonably concise and front-loaded with the core purpose. It could be more structured but is efficient.

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?

Given no output schema, the description sufficiently explains return values (file path or MCP image). Parameters are well covered, though error handling and output details could be expanded.

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 value by explaining the rationale for default output format (path avoids token bloat) and mentions environment variable, thus enhancing parameter understanding.

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 generates images via an OpenAI-compatible interface to Gemini model 'gemini-3-pro-image-preview', specifying default saving to local path versus returning base64. It precisely identifies the resource and action.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives or when not to use it. No siblings are listed, but the description does not provide any explicit usage context or preconditions.

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/sfz009900/geminiimagemcp_public'

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