Tool: send_message
Sends a new email message immediately from the authenticated user's Gmail account.
To send an existing draft message, provide the draftId. To send a new message, provide recipients in to, cc, or bcc, a subject, and message content in body or htmlBody (plain text in body, rich HTML in htmlBody; do NOT format body with Markdown). To thread the message under an existing thread or conversation, provide replyThreadId (preferred for send-only clients) or replyToMessageId. If sending a new message, attachments can be included via the attachments field, but the combined size cannot exceed 25MB. Set includeSignature to true to append the user's configured Gmail web signature when sending a new message (ignored if draftId is provided).
Returns a Message object with the id, threadId, and viewUrl (if available) fields populated (plus labelIds when draftId is provided).
The following code sample shows how to use curl to call the send_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": "send_message", "arguments": { // Provide these details according to the MCP tool specification. } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request message for Send RPC.
SendRequest
| JSON representation |
|---|
{
"to": [
string
],
"cc": [
string
],
"bcc": [
string
],
"subject": string,
"body": string,
"htmlBody": string,
"attachments": [
{
object ( |
| Fields | |
|---|---|
to[] |
Optional. The primary recipients of the email. Required if |
cc[] |
Optional. The carbon copy recipients of the email. Each string MUST be a valid plain email address (e.g., "user@example.com"). |
bcc[] |
Optional. The blind carbon copy recipients of the email. Each string MUST be a valid plain email address (e.g., "user@example.com"). |
subject |
Optional. The subject line of the email. |
body |
Optional. The plain text body content of the email. Do NOT format this field with Markdown (such as headers |
htmlBody |
Optional. The HTML content of the email. If provided, this will be used as the rich-text version of the email. Use this field (with valid HTML tags such as |
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 email. Ignored if |
Union field
|
|
draftId |
Optional. The unique identifier of an existing draft to send. If provided, the other fields ( |
Union field
|
|
replyToMessageId |
Optional. The unique identifier of the message to reply to. If provided, this message will be threaded in reply to the specified message. Note: Resolving a message by ID requires read permissions (e.g., 'gmail.modify' or 'gmail.compose'). If the caller only has send-only permissions ('gmail.send'), use |
Union field
|
|
replyThreadId |
Optional. The unique identifier of the thread to send this message in. If provided, the sent message will be threaded under the specified thread. Compatible with all scopes including send-only (gmail.send). |
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
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, "bccRecipients": [ 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 RFC 3339 UTC timestamp format (YYYY-MM-DDTHH:MM:SSZ). |
plaintextBody |
Full body content, only populated if MessageFormat was FULL_CONTENT or PLAIN_TEXT. |
attachmentIds[] |
Output only. The attachment ids, only populated if MessageFormat was FULL_CONTENT or PLAIN_TEXT. |
htmlBody |
The HTML content of the email, only populated if MessageFormat was FULL_CONTENT. |
bccRecipients[] |
BCC recipient email addresses. |
attachments[] |
Output only. The attachments, only populated if MessageFormat was FULL_CONTENT or PLAIN_TEXT. |
labelIds[] |
The ids of the labels attached to the message. Includes ids of user labels and standard system labels limited to |
raw |
The raw MIME message content, only populated if MessageFormat was RAW. |
threadId |
Output only. The ID of the thread this message belongs to. |
historyId |
Output only. The ID of the last history record that modified this message. |
internalDate |
Output only. The internal message creation timestamp (epoch ms). |
sizeEstimate |
Output only. Estimated size in bytes of the message. |
viewUrl |
Output only. Web URL to view the message in the Gmail Web UI. |
addressDisplayNames[] |
Output only. Contains display names from the |
Union field
|
|
originalMessageId |
Optional. Output only. The unique identifier of the original message that was forwarded. Only populated for forwarded messages. |
AttachmentMetadata
| JSON representation |
|---|
{ "id": string, "mimeType": string, "filename": string, "partId": string } |
| Fields | |
|---|---|
id |
Output only. The ID of the attachment. |
mimeType |
The MIME type of the attachment. |
filename |
The filename of the attachment. |
partId |
Output only. The MIME part ID of the attachment (e.g., "1", "0.1"). This represents the 0-indexed hierarchical position of the part within the email MIME tree. The root message container is omitted, so direct top-level parts are indexed as "0", "1", etc. (they do not start with a "0." prefix). Nested multipart children append their sub-index (e.g., "0.1", "0.2"). |
AddressDisplayName
| JSON representation |
|---|
{ "emailAddress": string, "displayName": string } |
| Fields | |
|---|---|
emailAddress |
Output only. Specifies the email address, matching a value in |
displayName |
Output only. Specifies the display name exactly as it appears in the header, for example |
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.modifyhttps://www.googleapis.com/auth/gmail.sendhttps://www.googleapis.com/auth/gmail.send.self