Skip to main content
Glama

gemini_generate_image

Generate an image from a text prompt and save it to a specified output path, returning the file path. Use a session ID to create follow-up variations that keep prior context.

Instructions

Generate an image and save it to output_path. Returns the saved path, not the image.

backend: "api" = google-genai SDK with GEMINI_API_KEY (API credit, fast); "agy" = agy's built-in generator (subscription, ~50 s per image). With a session_id, earlier images and analyses in that session are given as context, so "same character, brighter" style follow-ups work. Read the saved image to check it.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>",
      "output_path": "<output_path>"
    },
    "name": "gemini_generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYes
backendNoapi
session_idNo
output_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/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, and it discloses the two traits an agent most needs: the tool writes a file to disk and returns only the path, and backend "agy" incurs a substantial ~50 s latency while "api" consumes paid credit. Session behavior (prior images and analyses treated as context) is also spelled out. It does not state what happens if output_path already exists, nor any failure/error behavior, which keeps it below a 5.

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?

Leads with the highest-value sentence — what it does and that it returns a path, not an image — then a compact backend block and a session note. Every line carries information, but the indented backend block is visually awkward and the phrase "agy's built-in generator" assumes familiarity with that term.

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 4-parameter, unannotated, no-output-schema tool, the description covers return value, cost/latency trade-offs, statefulness via sessions, and the verification workflow (read the saved file). Missing pieces are overwrite semantics for output_path and any failure mode; no output schema exists, so the return-value note is doing the right work.

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, and it does for three of four parameters: both enum values of `backend` are explained with cost/latency trade-offs, `session_id` is explained as accumulating prior images and analyses, and `output_path` is identified as the save destination. The `prompt` parameter is never characterized (style, length, safety constraints), leaving one required parameter under-specified.

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?

States a specific verb and resource ("Generate an image") plus the side effect ("save it to output_path") and the return shape ("Returns the saved path, not the image"). That return note alone separates it from a naive assumption the tool hands back image bytes, and the image/audio noun distinction makes it trivially separable from gemini_generate_audio.

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?

Gives an explicit decision rule for the backend choice ("api" = API credit + fast vs "agy" = subscription, ~50 s per image), and explains that session_id enables iterative refinement like "same character, brighter". It also prescribes a follow-up step ("Read the saved image to check it"). It stops short of saying when to prefer this over analysis/session siblings, so it is context-rich rather than a full when/when-not rule set.

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