Skip to main content
Glama
Google Workspace MCP Server

Google Workspace MCP Server

by mutallipp

Get Gmail Message Content

get_gmail_message_content
Read-onlyIdempotent

Retrieves a specific Gmail message's subject, sender, recipients, and body; pages large bodies or exports complete messages when full content is needed.

Instructions

Retrieves the full content (subject, sender, recipients, body) of a specific Gmail message.

Set page_offset=0 to read the complete rendered body, excluding attachments and attached messages, as JSON pages of at most page_size characters. Follow next_offset until complete=true, passing body_sha256 as expected_sha256 and keeping body_format and include_links unchanged.

Bodies are returned inline and truncated at 20,000 characters. Set full=True to get the complete, untruncated message instead: it is exported to storage and the response carries a short-lived download URL (HTTP transport) or file path (stdio transport) rather than the body, so large messages never stream through the model context. Stateless deployments without GCS staging have no storage, so there full=True returns the untruncated body inline; with GCS staging configured it returns a signed download URL like any other HTTP deployment.

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": {
      "message_id": "<message_id>",
      "user_google_email": "<user_google_email>"
    },
    "name": "get_gmail_message_content"
  }
}

Input Schema

NameRequiredDescriptionDefault
fullNoWhen True, return the COMPLETE untruncated message: saved to storage and referenced by download URL/file path instead of the body text. In stateless mode without GCS staging, the body is returned inline; with GCS staging, a signed download URL is returned. Use for messages large enough to hit the truncation limit, or when byte-exact fidelity is needed (pair with body_format='raw' for a .eml export).
formatNoMessage format. "full" (default) includes the body and attachments, "metadata" only headers.full
page_sizeNoMaximum body characters per page, between 1 and 20,000.
message_idYesThe unique ID of the Gmail message to retrieve.
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
page_offsetNoCharacter offset in the complete rendered body. Start at 0 and follow next_offset.
include_linksNoWhen True, append a LINKS section listing the http(s) URLs from the HTML body that the text output omits. Only applies to body_format='text'.
expected_sha256NoOptional previous body_sha256; rejects changed content.
include_headersNoWhen False, omit the Subject/From/To/Date header summary (attached messages' too), and with full=True name the export after the message ID. Requires format='full'; body_format='raw' is only allowed when the raw message is exported to a file.
user_google_emailYesThe user's Google email address. Required.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.8.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already cover read-only, idempotent, non-destructive, and open-world behavior, but the description adds substantial context: attachments and attached messages are excluded, bodies are truncated at 20,000 characters, paging uses offsets and hash validation, and full=True switches to storage with either a short-lived download URL or file path depending on deployment. It also discloses the stateless-without-GCS fallback where full=True returns the body inline.

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 front-loaded with purpose, then covers paging, truncation, and full-export behavior. Its length is justified by the tool's stateful paging and deployment-dependent export modes, though some of the truncation and full=True behavior is repeated from the schema.

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 tool's complexity, 10 parameters, rich annotations, and output schema, the description is complete enough: it explains paging, truncation, full-message export, storage/download-URL behavior, and stateless deployment behavior. Return values themselves are left to the output schema, so no essential context is missing.

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 coverage is 100%, so individual parameter meanings are already well documented in the schema. The description still adds value by explaining cross-parameter workflow: start page_offset at 0, follow next_offset until complete, pass body_sha256 as expected_sha256, and keep body_format and include_links unchanged across pages.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: retrieving full content of a specific Gmail message, including subject, sender, recipients, and body. The purpose is clear, but the description does not explicitly differentiate this tool from siblings such as get_gmail_messages_content_batch, get_gmail_thread_content, get_gmail_attachment_content, or search_gmail_messages.

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

Usage Guidelines3/5

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

Provides operational usage guidance for paging via page_offset/next_offset and for full=True when the message is large or byte-exact fidelity is needed. However, it does not explicitly say when to use this tool versus sibling tools for batches, threads, attachments, or search, so tool-selection guidance remains implied rather than stated.

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

Deploy Server

Other Tools