Skip to main content
Glama
jonchun

Gemini Image Generator MCP Server

by jonchun

transform_image_from_encoded

Transform a base64-encoded image with Gemini using a text prompt, and optionally save the generated result to a chosen directory.

Instructions

Transform a base64-encoded image using Gemini.

Args: encoded_image: Base64 data URL (data:image/[format];base64,[data]). prompt: Text description of desired transformation. 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 transformed image, and optionally TextContent with file path if saved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNo
promptYes
output_dirNo
encoded_imageYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose some behavior: the output is returned in the response and optionally saved to disk depending on output_dir, and it reveals the GEMINI_MODEL env fallback for the model. However, it omits whether the call consumes Gemini quota, what happens on invalid base64, image size/format limits, and whether disk writes create or overwrite files. The return-format disclosure partially compensates but key mutation/side-effect info is missing.

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 Args/Returns structure is front-loaded with the purpose sentence, and each parameter line adds real information. It is somewhat verbose due to the Args/Returns scaffolding, and the model/ctx lines could be tighter, but nothing is wasted.

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?

With an output schema present, the description need not detail return values, though it still helpfully notes the return shape. For a 4-param tool with no annotations it covers purpose and all parameters well, but it leaves out API-key/auth requirements and failure/limit behavior that an agent might need to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 fully compensate, and it does: it documents all four parameters. It specifies encoded_image as a data URL with the exact format, prompt as the desired transformation text, output_dir's conditional save behavior when omitted, and model's GEMINI_MODEL env fallback. This is exactly the compensation the low schema coverage demands.

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?

The description states a specific verb+resource: 'Transform a base64-encoded image using Gemini.' It clearly distinguishes from the file-based sibling 'transform_image_from_file' via 'from_encoded'/base64 and from 'generate_image_from_text' by being a transformation of an existing image rather than generation. It doesn't explicitly name the siblings, but the base64 encoding distinction is unambiguous.

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?

Usage is implied by the 'from_encoded' scope (use it with base64 data URLs rather than local files), but the description never states when to prefer this over transform_image_from_file or generate_image_from_text. The data URL format note gives partial context. No explicit when-not or alternative tool routing is provided.

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