Get Gmail Message Content
get_gmail_message_contentRetrieve a Gmail message’s subject, sender, recipients, and body as paginated JSON, with options for raw HTML or complete export when the body exceeds truncation limits.
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| full | No | When 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). | |
| format | No | Message format. "full" (default) includes the body and attachments, "metadata" only headers. | full |
| page_size | No | Maximum body characters per page, between 1 and 20,000. | |
| message_id | Yes | The unique ID of the Gmail message to retrieve. | |
| body_format | No | Body 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_offset | No | Character offset in the complete rendered body. Start at 0 and follow next_offset. | |
| include_links | No | When 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_sha256 | No | Optional previous body_sha256; rejects changed content. | |
| include_headers | No | When 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_email | Yes | The user's Google email address. Required. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |