Skip to main content
Glama

generate_gemini_image

Generate or edit images from text prompts and optional reference images, saving results to your project. Uses Gemini image models via chat completions.

Instructions

Generate or edit images with POST /v1/chat/completions using a Gemini image model. Do not call /v1/images/* for Gemini image models.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoConfigured model to start with. Defaults to the first model configured for this tool.
imagesNoOptional local image paths sent as user content image_url data URLs (max 16).
promptYesText prompt
filenameNoOptional AI-chosen basename (Unicode allowed, up to 200 UTF-8 bytes, optional extension). Requires output_path to be a directory. Existing names get numbered suffixes instead of being overwritten. Unsafe names are rejected before generation, not rewritten.
output_pathYesFile or directory to write. Relative paths resolve against process.cwd().
aspect_ratioNoOptional image_config.aspect_ratio
auto_fallbackNoTry the next configured model after an upstream failure. Overrides GEN_IMAGE_AUTO_FALLBACK.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.2.2
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / filename
      Added value: +{
      +  "description": "Optional AI-chosen basename (Unicode allowed, up to 200 UTF-8 bytes, optional extension). Requires output_path to be a directory. Existing names get numbered suffixes instead of being overwritten. Unsafe names are rejected before generation, not rewritten.",
      +  "type": "string"
      +}
    • addedInput schema / properties / images / items / minLength
      Added value: +1
  2. First observedv0.1.0

TDQS

A3.6/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 behavioral burden. It discloses the endpoint used (POST /v1/chat/completions) and the model family, which is useful. However, it doesn't disclose output behavior, file-writing semantics, or failure modes beyond the schema's filename notes. The description adds some context but not rich behavioral detail.

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?

Two sentences, front-loaded with the core action and the critical endpoint exclusion. The second sentence is a clear directive. No wasted words, though it could have named sibling tools for extra routing value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 7 parameters, 100% schema coverage, and no output schema, the description is adequate but thin. It explains the endpoint and model family, but doesn't clarify when to prefer this over generate_image/edit_image, nor what the tool returns. The schema covers parameters, but the tool-level context is incomplete.

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?

Schema description coverage is 100%, so the schema already documents all 7 parameters. The description adds the endpoint context and the model-family constraint, but doesn't add parameter-level meaning beyond the schema. Baseline 3 is appropriate.

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 ('Generate or edit images') and resource ('Gemini image model'), and explicitly distinguishes from the /v1/images/* endpoint family. It doesn't fully differentiate from sibling tools generate_image and edit_image, but the endpoint guidance and model family naming provide reasonable clarity.

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 gives an explicit 'Do not call /v1/images/* for Gemini image models' exclusion, which is a clear when-not-to-use signal. It doesn't name sibling tools generate_image or edit_image as alternatives, but the endpoint-level guidance is actionable and contextually useful.

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