MCP Tools Reference: gmailmcp.googleapis.com

Tool: create_draft

Creates a new draft email in the authenticated user's Gmail account.

This tool takes recipient addresses, a subject, and body content as inputs. 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.

Returns only the unique ID (id) of the draft message.

Limitation: Creating drafts with attachments is not supported yet.

The following sample demonstrate how to use curl to invoke 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 tool's MCP 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 (Attachment)
    }
  ]
}
Fields
to[]

string

Optional. The primary recipients of the email draft. Each string MUST be a valid plain email address (e.g., "user@example.com"). The "Name email@example.com" format is NOT supported by this tool.

cc[]

string

Optional. The carbon copy recipients of the email draft. Each string MUST be a valid plain email address (e.g., "user@example.com"). The "Name email@example.com" format is NOT supported by this tool.

bcc[]

string

Optional. The blind carbon copy recipients of the email draft. Each string MUST be a valid plain email address (e.g., "user@example.com"). The "Name email@example.com" format is NOT supported by this tool.

subject

string

Optional. The subject line of the email. Defaults to empty if not provided.

body

string

Optional. The main body content of the email draft. If html_body is also provided, this field is treated as the plain-text alternative.

htmlBody

string

The HTML content of the email draft. If provided, this will be used as the rich-text version of the email.

replyToMessageId

string

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 body and html_body will be appended to the original message body.

attachments[]

object (Attachment)

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 body or html_body.

Attachment

JSON representation
{
  "id": string,
  "filename": string,
  "mimeType": string,
  "content": string,
  "inline": boolean
}
Fields
id

string

Optional. Output only. When present, contains the ID of an external attachment that can be retrieved in a separate GetMessageAttachment request.

filename

string

Optional. The name of the file to be attached, e.g. "invoice.pdf". For inline attachments, this is used for Content-ID generation. For regular attachments, filename is used to specify the filename to email clients. If not provided, the attachment may be received with no name.

mimeType

string

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

string (bytes format)

Required. The base64-encoded content of the attachment.

A base64-encoded string.

inline

boolean

Optional. If true, this attachment is handled as inline. An inline attachment is a content that is intended to be displayed within the body of an HTML email, as opposed to being listed as a separate file for download. If false or absent, defaults to false, and it's treated as a regular attachment.

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
}
Fields
id

string

The unique identifier of the draft resource.

subject

string

The subject line of the draft message.

threadId

string

The ID of the thread this draft belongs to.

toRecipients[]

string

List of 'To' recipient email addresses extracted from headers.

ccRecipients[]

string

List of 'Cc' recipient email addresses extracted from headers.

bccRecipients[]

string

List of 'Bcc' recipient email addresses extracted from headers.

plaintextBody

string

Plain text body content, if available.

date

string

Date of the draft in ISO 8601 format (YYYY-MM-DD).

htmlBody

string

The HTML body content of the draft, if available.

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.compose