Skip to main content
Glama
jonchun

Gemini Image Generator MCP Server

by jonchun

generate_image_from_text

Create an image from a text prompt using Gemini AI, with optional saving to a directory.

Instructions

Generate an image from a text prompt using Gemini.

Args: prompt: Text description of the desired image. output_dir: Optional directory to save the generated image. If not provided, the image is only returned in the response (not saved to disk). model: Optional Gemini model name. If not provided, uses GEMINI_MODEL environment variable. ctx: Optional context for progress reporting.

Returns: List containing ImageContent with the generated image, and optionally TextContent with file path if saved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNo
promptYes
output_dirNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses that the image is returned in the response and only saved to disk if output_dir is given, and that model falls back to the GEMINI_MODEL environment variable. It stops short of covering auth requirements, rate limits, or error behavior.

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?

Front-loaded with a one-line purpose, then organized Args/Returns sections. Efficient overall, though the Returns block partially duplicates the output schema.

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?

All three parameters are explained, the optional persistence behavior is confirmed, and an output schema exists so return details need not be restated. Missing only selection guidance relative to the transform siblings.

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 description coverage is 0%, so the description must compensate for all three parameters and it largely does: prompt, output_dir (with its disk-vs-response consequence), and model (with its env-var fallback) each get meaningful explanation beyond the bare schema types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: 'Generate an image from a text prompt using Gemini.' This clearly distinguishes it from the sibling transform_image_* tools, which transform existing images rather than generating new ones, though it never explicitly names those siblings.

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 when-to-use or when-not-to-use guidance is offered. The agent must infer that this is the generation path versus the transformation siblings purely from the verb. The output_dir default behavior is described, but that is parameter semantics rather than selection guidance.

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