Skip to main content
Glama

Batch Gemini Prompts

gemini-batch

Run multiple independent Gemini prompts in parallel for code review, multi-file analysis, and test generation, replacing sequential requests while isolating individual failures.

Instructions

Run multiple independent prompts in parallel, leveraging the existing concurrency infrastructure (semaphore + warm pool). Useful for parallel code review, multi-file analysis, and test generation — replacing N sequential ask-gemini calls with a single request. Returns all results when complete (wait: true, default) or job IDs for polling (wait: false). Individual failures are isolated: other items still complete successfully.

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": {
      "prompts": "<prompts>"
    },
    "name": "gemini-batch"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoRequired when the prompt contains 2 or more @file references. A single @file ref is resolved by the CLI without cwd. If cwd is omitted with 2+ @file refs and the client supports elicitation, you will be prompted to provide it.
waitNoIf true (default), block until all prompts complete and return all results inline. If false, return job IDs immediately for polling with gemini-poll.
modelNoGemini model to use (e.g. gemini-3-flash-preview, gemini-3-pro-preview). Defaults to CLI default.
promptsYes1–20 independent prompts to run in parallel
expandRefsNoSet to false to disable @file reference expansion.

Output Schema

NameRequiredDescriptionDefault
jobsNo
resultsNo
summaryNo
pollIntervalMsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.11.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false and openWorldHint=true but say nothing about failure semantics; the description fills that gap with 'Individual failures are isolated: other items still complete successfully' and describes the two return modes (inline results vs job IDs). It omits cost/rate-limit implications of fanning out up to 20 prompts, which is the main remaining behavioral unknown.

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?

Three tight sentences with the core action and the ask-gemini comparison front-loaded, followed by return-mode and failure semantics. The parenthetical '(semaphore + warm pool)' is internal implementation detail that adds little for an agent, but the rest is efficiently ordered.

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 5-parameter batch tool with an output schema, the description covers the essentials: parallel model, return modes, polling target, and partial-failure isolation. What's left (error shape per failed item, cost of large batches) is either in the output schema or minor.

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 coverage is 100%, so each parameter is already documented, and the description largely restates the wait flag behavior that the schema states verbatim. The cwd/@file elicitation nuance and the 1–20 bound live in the schema, not the description, so no meaningful meaning is added beyond it.

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 ('Run multiple independent prompts in parallel') and immediately contrasts it with the sibling it replaces: 'replacing N sequential ask-gemini calls with a single request.' An agent can distinguish this from ask-gemini without opening either schema.

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 concrete scenarios (parallel code review, multi-file analysis, test generation) and explains the wait:true vs wait:false split, routing the async path to gemini-poll by name. It stops short of an explicit rule like 'for a single prompt, use ask-gemini instead' — that is only implied by 'N sequential ask-gemini calls.'

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