## Tool: `get_message`

> [!WARNING]
> **Developer Preview:** Available as part of the [Google Workspace Developer Preview Program](https://developers.google.com/workspace/preview), which grants early access to certain features.

Retrieves a specific email message from the authenticated user's Gmail account by its unique message ID.

Use this tool to inspect a single, individual email when you already know its message ID. If the user wants to read a specific email in detail, check the exact wording of a message, or examine attachment metadata for a single email, this is the right tool. It is not suitable for retrieving entire conversations or viewing back-and-forth discussion threads; use the 'get_thread' tool instead. Key indicators include if the user asks for the full content of a specific message ID returned by a previous search, or if the query asks to inspect a specific individual email rather than an entire thread. Example user prompts are: "Get the full text of message ID 18f123456789abcd.", "Read the latest message in that thread from Alice.", and "What are the attachment names in the email I just received from HR?"

The optional `messageFormat` parameter controls the format of the message returned. By default (or with `FULL_CONTENT`), it returns the full content of the message. Use `MINIMAL` to include only subject and snippet (excluding body). Use `METADATA_ONLY` to include only basic metadata (message ID, thread ID, labels, timestamp, and size estimate).

The following sample demonstrate how to use `curl` to invoke the `get_message` MCP tool.

| Curl Request |
|---|
| ```bash curl --location 'https://gmailmcp.googleapis.com/mcp/v1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'content-type: application/json' \ --header 'accept: application/json, text/event-stream' \ --data '{ "method": "tools/call", "params": { "name": "get_message", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' ``` |

## Input Schema

Request message for GetMessage RPC.

### GetMessageRequest

| JSON representation |
|---|
| ``` { "messageId": string, "messageFormat": enum (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/get_thread#Input.Schema.MessageFormat`) } ``` |

| Fields ||
|---|---|
| `messageId` | `string` Required. The unique identifier of the message to fetch. |
| `messageFormat` | ``enum (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/get_thread#Input.Schema.MessageFormat`)`` Optional. Specifies the format of the message returned. Defaults to FULL_CONTENT. |

### MessageFormat

Enum to control the level of detail for messages in the thread.

| Enums ||
|---|---|
| `MESSAGE_FORMAT_UNSPECIFIED` | Defaults to FULL_CONTENT. |
| `MINIMAL` | Returns message snippets and key headers (Subject, From, To, Cc, Date). |
| `FULL_CONTENT` | Returns all information in "MINIMAL" plus the full body content of each message. |
| `METADATA_ONLY` | Metadata only: does not include subject, snippet, body, attachment filenames. |

## Output Schema

Message within a thread.

### Message

| JSON representation |
|---|
| ``` { "id": string, "snippet": string, "subject": string, "sender": string, "toRecipients": [ string ], "ccRecipients": [ string ], "date": string, "plaintextBody": string, "attachmentIds": [ string ], "htmlBody": string, "attachments": [ { object (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/send_message#Output.Schema.AttachmentMetadata`) } ], "labelIds": [ string ] } ``` |

| Fields ||
|---|---|
| `id` | `string` The unique identifier of the message. |
| `snippet` | `string` Snippet of the message body. |
| `subject` | `string` The message subject extracted from headers: |
| `sender` | `string` Sender email address. |
| `toRecipients[]` | `string` To recipient email addresses. |
| `ccRecipients[]` | `string` CC recipient email addresses. |
| `date` | `string` Date of the message in ISO 8601 format (YYYY-MM-DD). |
| `plaintextBody` | `string` Full body content, only populated if MessageFormat was FULL_CONTENT. |
| `attachmentIds[]` | `string` Output only. The attachment ids, only populated if MessageFormat was FULL_CONTENT. |
| `htmlBody` | `string` The HTML content of the email, only populated if MessageFormat was FULL_CONTENT. |
| `attachments[]` | ``object (`https://developers.google.com/workspace/gmail/api/reference/mcp/tools_list/send_message#Output.Schema.AttachmentMetadata`)`` Output only. The attachments, only populated if MessageFormat was FULL_CONTENT. |
| `labelIds[]` | `string` The ids of the labels attached to the message. Includes ids of user labels and standard system labels limited to `INBOX`, `SPAM`, `TRASH`, `UNREAD`, `STARRED`, `IMPORTANT`, `SENT`, `DRAFT`, `CHAT`. |

### AttachmentMetadata

| JSON representation |
|---|
| ``` { "id": string, "mimeType": string, "filename": string } ``` |

| Fields ||
|---|---|
| `id` | `string` Output only. The ID of the attachment. |
| `mimeType` | `string` The MIME type of the attachment. |
| `filename` | `string` The filename of the attachment. |

### Tool Annotations

Destructive Hint: ❌ \| Idempotent Hint: ✅ \| Read Only Hint: ✅ \| Open World Hint: ❌

## Authorization Scopes

Requires one of the following OAuth scopes:

- `https://mail.google.com/`
- `https://www.googleapis.com/auth/gmail.modify`
- `https://www.googleapis.com/auth/gmail.readonly`
- `https://www.googleapis.com/auth/gmail.metadata`