Skip to main content
Glama

Batch Submit

gemini_batch_submit

Submit batch image generation requests to Gemini API at 50% reduced cost. Builds JSONL file, uploads via Files API, and returns batch ID for tracking.

Instructions

Submit a batch of image generation requests to the Gemini API at 50% reduced cost.

Builds a JSONL file, uploads it to the Gemini Files API, and submits a batch job. The job processes asynchronously (usually completes within minutes). Returns the batch ID — the caller is responsible for tracking it (e.g. in Supabase).

Args:

  • requests (string, required): JSON array of request objects. Each object must have:

    • key (string): Unique identifier for this request (used as output filename)

    • prompt (string): The image generation prompt

    • aspect_ratio (string, optional): Aspect ratio for this image

    • image_paths (string, optional): Comma-separated input image paths for editing (slow — base64 encodes each) Example: [{"key":"sunset-cat","prompt":"A cat watching a sunset","aspect_ratio":"16:9"}]

  • file_uris (string, optional): Comma-separated Gemini Files API URIs of pre-uploaded reference images (e.g. "files/abc123,files/def456"). These are shared across ALL requests in the batch. Use gemini_upload_image first to get URIs. Much faster than image_paths for large batches.

  • model (string, optional): Gemini model ID. Defaults to "gemini-3.1-flash-image-preview".

  • image_size (string, optional): Output image resolution. Values: "1K" (1024px), "2K" (2048px), "4K" (4096px). Defaults to "2K".

  • display_name (string, optional): Human-readable name for the batch job.

Returns:

  • The batch name/ID, request count, and model used.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoGemini model ID (default: gemini-3.1-flash-image-preview)gemini-3.1-flash-image-preview
requestsYesJSON array of {key, prompt, aspect_ratio?, image_paths?} objects
file_urisNoComma-separated Gemini file URIs of pre-uploaded reference images shared across all requests (e.g. "files/abc,files/def")
image_sizeNoOutput image resolution: "1K" (1024px), "2K" (2048px), or "4K" (4096px). Default: "2K"2K
display_nameNoHuman-readable name for the batch job
Behavior4/5

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

The description discloses async processing, file upload steps, and return of batch ID. Annotations already indicate a write operation (readOnlyHint=false) and non-destructive behavior. However, it could mention failure handling or rate limits, but overall adds good context beyond annotations.

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 well-structured with clear sections (args, returns) and uses concise language. It is not excessively long, though some redundancy exists (e.g., listing fields already in schema). Overall efficient.

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

Completeness5/5

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

Given 5 parameters, no output schema, the description fully covers the return value (batch ID, count, model), async nature, and tracking responsibility. It also relates to sibling tools (gemini_upload_image). Highly complete for an agent to use 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?

With 100% schema coverage, baseline is 3, but the description greatly enriches understanding: explains that 'requests' requires key, prompt, and optional fields; provides an example; distinguishes file_uris as faster; and clarifies image_size values. This goes well beyond the schema descriptions.

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 starts with 'Submit a batch of image generation requests to the Gemini API at 50% reduced cost,' clearly stating the action and resource. It distinguishes from sibling tools by focusing on submission, while siblings handle results/status.

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

Usage Guidelines5/5

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

The description explains when to use this tool (for cost-effective batch generation) and provides guidance on alternatives: recommends using file_uris over image_paths for speed, and notes that the caller is responsible for tracking the batch ID. This effectively sets context for usage.

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/slackermafia/NanoBanana-MCP-Server'

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