Skip to main content
Glama

get_gmail_messages_content_batch

Fetch multiple Gmail messages in a single batch call using the Gmail batch API, with auto-chunking of 25 per request. Supports full content or metadata-only retrieval for faster triage.

Instructions

Fetch many Gmail messages in one batch, chunked internally.

Prefer this over calling get_gmail_message_content in a loop — uses the Gmail batch API (25 per request, auto-chunked) and falls back to sequential fetches if the batch call fails. Use format="metadata" when you only need headers for triage (cheaper + faster). Requires the gmail.readonly OAuth scope.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
message_idsYesList of Gmail message IDs from search_gmail_messages. No hard cap — the tool chunks into batches of 25 automatically.
user_google_emailYesThe user's Google email address (authenticated account).
formatNo"full" (headers + body) or "metadata" (headers only, much faster for listing triage).full
body_formatNoBody output format (only applies when format='full'). 'text' (default) returns plaintext (HTML converted to text as fallback). 'html' returns the raw HTML body as-is without conversion. 'raw' fetches the full raw MIME message and returns the base64url-decoded content.text

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries full burden. It discloses internal chunking, fallback behavior, format options, and auth scope. While not exhaustive (e.g., rate limits, error handling beyond fallback), it provides sufficient transparency for safe usage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three well-structured sentences: first states core action, second provides usage guidance and internal details, third adds format recommendation and auth requirement. No unnecessary words, perfectly front-loaded.

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 the presence of an output schema, the description need not detail return values. It covers batch behavior, alternatives, format nuances, and auth requirement, making it complete for the tool's complexity.

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?

The schema already covers parameters 100% with descriptions. The description adds value by clarifying message_ids has no hard cap (auto-chunked), format='metadata' is faster for triage, and body_format applies only when format='full'. This enhances understanding beyond the schema.

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 the tool fetches many Gmail messages in batch, internally chunked. It distinguishes itself from the sibling tool get_gmail_message_content by recommending this batch approach, making its purpose unambiguous.

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?

Explicitly advises to prefer this over a loop of get_gmail_message_content, explains the batch API chunking (25 per request) and fallback to sequential fetches, and recommends using format='metadata' for headers-only triage. Also specifies the required OAuth scope, providing comprehensive usage guidance.

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/HuntsDesk/ve-gws'

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