Tool: get_draft
Retrieves a specific draft email from the authenticated user's Gmail account by ID, including its viewUrl for viewing and editing in the Gmail Web UI.
The optional messageFormat parameter controls the format of the draft returned. By default (or with PLAIN_TEXT), it returns the plain text body without the HTML body. Use MINIMAL to return snippet and key headers, METADATA_ONLY to exclude snippet, subject, and body, FULL_CONTENT for the complete draft including the HTML body, or RAW for the raw MIME message content.
The following code sample shows how to use curl to call the get_draft 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_draft", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for GetDraft RPC.
GetDraftRequest
| JSON representation |
|---|
{
"draftId": string,
"messageFormat": enum ( |
| Fields | |
|---|---|
draftId |
Required. The unique identifier of the draft to fetch. |
messageFormat |
Optional. Specifies the format of the draft returned. Defaults to |
MessageFormat
Enum to control the level of detail for a returned message or draft.
| Enums | |
|---|---|
MESSAGE_FORMAT_UNSPECIFIED |
Defaults to PLAIN_TEXT. |
MINIMAL |
Returns id, snippet, subject, sender, toRecipients, ccRecipients, bccRecipients, date, labelIds, viewUrl (if applicable), plus addressDisplayNames on messages. Omits plaintextBody, htmlBody, attachmentIds, attachments. |
FULL_CONTENT |
Returns all populated fields for the message or draft (id, snippet, subject, sender, toRecipients, ccRecipients, bccRecipients, date, labelIds, plaintextBody, htmlBody, viewUrl, plus addressDisplayNames, attachmentIds, and attachments on messages) if applicable. |
METADATA_ONLY |
Returns id, sender, toRecipients, ccRecipients, bccRecipients, date, labelIds, viewUrl (if applicable), plus addressDisplayNames on messages. Omits subject, snippet, plaintextBody, htmlBody, attachmentIds, attachments. |
PLAIN_TEXT |
Returns all information in MINIMAL plus plaintextBody (and attachmentIds and attachments on messages, if applicable). If plain text body is not available, converts the HTML body to plain text/markdown. Omits htmlBody. |
RAW |
Returns the raw MIME message content. |
Output Schema
Details of a draft.
Draft
| JSON representation |
|---|
{ "id": string, "subject": string, "threadId": string, "toRecipients": [ string ], "ccRecipients": [ string ], "bccRecipients": [ string ], "plaintextBody": string, "date": string, "htmlBody": string, "messageId": string, "sender": string, "snippet": string, "labelIds": [ string ], "raw": string, "viewUrl": string } |
| Fields | |
|---|---|
id |
The unique identifier of the draft resource. |
subject |
The subject line of the draft message. |
threadId |
The ID of the thread this draft belongs to. |
toRecipients[] |
List of 'To' recipient email addresses extracted from headers. |
ccRecipients[] |
List of 'Cc' recipient email addresses extracted from headers. |
bccRecipients[] |
List of 'Bcc' recipient email addresses extracted from headers. |
plaintextBody |
Plain text body content, if available. |
date |
Date of the draft in RFC 3339 UTC timestamp format (YYYY-MM-DDTHH:MM:SSZ). |
htmlBody |
The HTML body content of the draft, if available. |
messageId |
The ID of the message associated with this draft. |
sender |
Sender email address. |
snippet |
Snippet of the message body. |
labelIds[] |
The ids of the labels attached to the draft message. |
raw |
The raw MIME message content, only populated if MessageFormat was RAW. |
viewUrl |
Output only. Web URL to view the draft in the Gmail Web UI. |
Tool Annotations
Tool annotations are sent to MCP clients to describe the basic risk of a given tool. Most clients treat these hints as untrusted, but they can be used to decide when a confirmation prompt might be sent to a user.
Along with the title string, the following boolean hints are defined as follows:
readOnlyHint: If true, the tool doesn't modify its environment. Default: false.destructiveHint: If true, then the tool can perform destructive actions. If false, then the tool can only perform additive actions. Default: true.idempotentHint: If true, then calling the tool repeatedly with the same arguments will have no additional effect on its environment. Default: false.openWorldHint: If true, then the tool can interact with an 'open world' of external entities. If false, then the tool can only interact with internal entities. For example, a web search tool would be open world, while a memory tool would not be open world.
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.composehttps://www.googleapis.com/auth/gmail.readonlyhttps://www.googleapis.com/auth/gmail.draftshttps://www.googleapis.com/auth/gmail.drafts.readonly