draft_gmail_message
Create Gmail draft emails, including replies, with support for CC, BCC, HTML, and threading. Specify recipient, subject, and body to draft new messages or reply within existing threads.
Instructions
Creates a draft email in the user's Gmail account. Supports both new drafts and reply drafts.
Args: user_google_email (str): The user's Google email address. Required. subject (str): Email subject. body (str): Email body (plain text). body_format (Literal['plain', 'html']): Email body format. Defaults to 'plain'. to (Optional[str]): Optional recipient email address. Can be left empty for drafts. cc (Optional[str]): Optional CC email address. bcc (Optional[str]): Optional BCC email address. thread_id (Optional[str]): Optional Gmail thread ID to reply within. When provided, creates a reply draft. in_reply_to (Optional[str]): Optional Message-ID of the message being replied to. Used for proper threading. references (Optional[str]): Optional chain of Message-IDs for proper threading. Should include all previous Message-IDs.
Returns: str: Confirmation message with the created draft's ID.
Examples: # Create a new draft draft_gmail_message(subject="Hello", body="Hi there!", to="user@example.com")
# Create a plaintext draft with CC and BCC
draft_gmail_message(
subject="Project Update",
body="Here's the latest update...",
to="user@example.com",
cc="manager@example.com",
bcc="archive@example.com"
)
# Create a HTML draft with CC and BCC
draft_gmail_message(
subject="Project Update",
body="<strong>Hi there!</strong>",
body_format="html",
to="user@example.com",
cc="manager@example.com",
bcc="archive@example.com"
)
# Create a reply draft in plaintext
draft_gmail_message(
subject="Re: Meeting tomorrow",
body="Thanks for the update!",
to="user@example.com",
thread_id="thread_123",
in_reply_to="<message123@gmail.com>",
references="<original@gmail.com> <message123@gmail.com>"
)
# Create a reply draft in HTML
draft_gmail_message(
subject="Re: Meeting tomorrow",
body="<strong>Thanks for the update!</strong>",
body_format="html,
to="user@example.com",
thread_id="thread_123",
in_reply_to="<message123@gmail.com>",
references="<original@gmail.com> <message123@gmail.com>"
)Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Optional CC email address. | |
| to | No | Optional recipient email address. | |
| bcc | No | Optional BCC email address. | |
| body | Yes | Email body (plain text). | |
| subject | Yes | Email subject. | |
| thread_id | No | Optional Gmail thread ID to reply within. | |
| references | No | Optional chain of Message-IDs for proper threading. | |
| body_format | No | Email body format. Use 'plain' for plaintext or 'html' for HTML content. | plain |
| in_reply_to | No | Optional Message-ID of the message being replied to. | |
| user_google_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |