Skip to main content
Glama

generate_content_batch

Process multiple Gemini content generation requests in parallel, each with unique identifiers. Returns success or failure status for each request.

Instructions

Generate multiple contents concurrently using Gemini. This tool allows you to send multiple requests in parallel for better performance.

Each request in the batch requires a unique 'id' field to identify results. All other parameters are the same as generate_content.

Example usage:

{
  "requests": [
    {
      "id": "req1",
      "user_prompt": "Describe image 1",
      "files": [{"path": "/image1.jpg"}]
    },
    {
      "id": "req2", 
      "user_prompt": "Describe image 2",
      "files": [{"path": "/image2.jpg"}]
    },
    {
      "id": "req3",
      "user_prompt": "Summarize this document",
      "files": [{"path": "/doc.pdf"}]
    }
  ],
  "max_concurrency": 5
}

The response includes success/failure status for each request:

{
  "total": 3,
  "succeeded": 2,
  "failed": 1,
  "results": [
    {"id": "req1", "success": true, "content": "..."},
    {"id": "req2", "success": true, "content": "..."},
    {"id": "req3", "success": false, "error": "..."}
  ]
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestsYesArray of generation requests to process concurrently
max_concurrencyNoMaximum concurrent requests (1-20)
Behavior3/5

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

No annotations are provided, so the description must cover behavioral traits. It mentions concurrent execution and performance benefits, and shows a response format with success/failure per request. However, it does not disclose potential side effects, auth requirements, or rate limits.

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 an example, front-loading the purpose and concurrency benefit. It is slightly lengthy but every sentence serves a purpose; the example is helpful.

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?

Given the absence of an output schema, the description includes a detailed response format example. It covers the `id` requirement and `max_concurrency` parameter, differentiating from `generate_content`. Some details like error handling beyond the response format are missing.

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 baseline is 3. The description adds value by explaining the 'id' field requirement and showing an example, but does not significantly expand on other parameters beyond what the schema already provides.

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 clearly states 'Generate multiple contents concurrently using Gemini', specifying the verb 'generate' and resource 'multiple contents'. It distinguishes from the sibling tool 'generate_content' by emphasizing concurrency and batch processing.

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 explains that this tool is for multiple requests in parallel for better performance, implying its use case. However, it does not explicitly state when to use the single request alternative or provide exclusions.

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/2799662352/apiyi-mcp-server'

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