Tool: get_message
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 |
|---|
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 ( |
| Fields | |
|---|---|
messageId |
Required. The unique identifier of the message to fetch. |
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 ( |
| Fields | |
|---|---|
id |
The unique identifier of the message. |
snippet |
Snippet of the message body. |
subject |
The message subject extracted from headers: |
sender |
Sender email address. |
toRecipients[] |
To recipient email addresses. |
ccRecipients[] |
CC recipient email addresses. |
date |
Date of the message in ISO 8601 format (YYYY-MM-DD). |
plaintextBody |
Full body content, only populated if MessageFormat was FULL_CONTENT. |
attachmentIds[] |
Output only. The attachment ids, only populated if MessageFormat was FULL_CONTENT. |
htmlBody |
The HTML content of the email, only populated if MessageFormat was FULL_CONTENT. |
attachments[] |
Output only. The attachments, only populated if MessageFormat was FULL_CONTENT. |
labelIds[] |
The ids of the labels attached to the message. Includes ids of user labels and standard system labels limited to |
AttachmentMetadata
| JSON representation |
|---|
{ "id": string, "mimeType": string, "filename": string } |
| Fields | |
|---|---|
id |
Output only. The ID of the attachment. |
mimeType |
The MIME type of the attachment. |
filename |
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.modifyhttps://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.metadata