Tool: create_draft
Creates a new draft email in the authenticated user's Gmail account.
This tool takes recipient addresses (to, cc, bcc), a subject, and body content as inputs. Plain text body content can be provided in body (do NOT format body with Markdown), and rich-text HTML content can be provided in htmlBody (use valid HTML tags for formatting; if both are provided, body serves as the plain-text alternative). If the draft is created as a reply to an existing message, the ID of the original message should be passed to the tool in the replyToMessageId field. Set includeSignature to true to append the user's configured Gmail web signature to the draft.
Returns a Draft object with the id, threadId, and viewUrl fields populated.
The following code sample shows how to use curl to call the create_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": "create_draft", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for CreateDraft RPC.
CreateDraftRequest
| JSON representation |
|---|
{
"to": [
string
],
"cc": [
string
],
"bcc": [
string
],
"subject": string,
"body": string,
"htmlBody": string,
"replyToMessageId": string,
"attachments": [
{
object ( |
| Fields | |
|---|---|
to[] |
Optional. The primary recipients of the email draft. Each string MUST be a valid plain email address (e.g., "user@example.com"). |
cc[] |
Optional. The carbon copy recipients of the email draft. Each string MUST be a valid plain email address (e.g., "user@example.com"). |
bcc[] |
Optional. The blind carbon copy recipients of the email draft. Each string MUST be a valid plain email address (e.g., "user@example.com"). |
subject |
Optional. The subject line of the email. Defaults to empty if not provided. |
body |
Optional. The plain text body content of the email draft. Do NOT format this field with Markdown (such as headers |
htmlBody |
Optional. The HTML content of the email draft. If provided, this will be used as the rich-text version of the email. Use this field (with valid HTML tags such as |
replyToMessageId |
Optional. The ID of the message to reply to. If provided, this will be used as the reply-to message ID for the email draft, and the |
attachments[] |
Optional. The attachments to include in the email. The combined size of attachments in the message cannot exceed 25MB. If you need to send files larger than 25MB, upload the file to Drive first and then insert the Drive link into |
includeSignature |
Optional. Whether to append the user's configured Gmail web signature to the draft. Defaults to false. |
Attachment
| JSON representation |
|---|
{ "id": string, "filename": string, "mimeType": string, "content": string, "inline": boolean } |
| Fields | |
|---|---|
id |
Output only. When present, contains the ID of an external attachment. |
filename |
Optional. The name of the file to be attached, e.g. "invoice.pdf". Email clients show this name to recipients for both regular and inline attachments. If not provided, the attachment may be received with no name. |
mimeType |
Optional. The field representing a content or media type must use IANA MIME type, https://www.iana.org/assignments/media-types/media-types.xhtml. If not provided, defaults to "application/octet-stream". |
content |
Required. The base64-encoded content of the attachment. A base64-encoded string. |
inline |
Optional. If |
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.composehttps://www.googleapis.com/auth/gmail.draftshttps://www.googleapis.com/auth/gmail.drafts.createhttps://www.googleapis.com/auth/gmail.modify