Skip to main content
Glama
Google Workspace MCP Server

Google Workspace MCP Server

by akilja24

draft_gmail_message

Creates new or reply Gmail drafts with recipients, CC/BCC, HTML or plain text, aliases, attachments, and thread IDs so you can prepare emails before sending.

Instructions

Creates a draft email in the user's Gmail account. Supports both new drafts and reply drafts with optional attachments. Supports Gmail's "Send As" feature to draft from configured alias addresses.

Args: user_google_email (str): The user's Google email address. Required for authentication. 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. from_name (Optional[str]): Optional sender display name. If provided, the From header will be formatted as 'Name '. from_email (Optional[str]): Optional 'Send As' alias email address. The alias must be configured in Gmail settings (Settings > Accounts > Send mail as). If not provided, the draft will be from the authenticated user's primary 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. attachments (List[Dict[str, str]]): Optional list of attachments. Each dict can contain: Option 1 - File path (auto-encodes): - 'path' (required): File path to attach - 'filename' (optional): Override filename - 'mime_type' (optional): Override MIME type (auto-detected if not provided) Option 2 - Base64 content: - 'content' (required): Standard base64-encoded file content (not urlsafe) - 'filename' (required): Name of the file - 'mime_type' (optional): MIME type (defaults to 'application/octet-stream')

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 draft from a configured alias (Send As)
draft_gmail_message(
    subject="Business Inquiry",
    body="Hello from my business address...",
    to="user@example.com",
    from_email="business@mydomain.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>"
)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "user_google_email": "<user_google_email>",
      "subject": "<subject>",
      "body": "<body>"
    },
    "name": "draft_gmail_message"
  }
}

Input Schema

NameRequiredDescriptionDefault
ccNoOptional CC email address.
toNoOptional recipient email address.
bccNoOptional BCC email address.
bodyYesEmail body (plain text).
subjectYesEmail subject.
from_nameNoOptional sender display name (e.g., 'Peter Hartree'). If provided, the From header will be formatted as 'Name <email>'.
thread_idNoOptional Gmail thread ID to reply within.
from_emailNoOptional 'Send As' alias email address. Must be configured in Gmail settings (Settings > Accounts > Send mail as). If not provided, uses the authenticated user's email.
referencesNoOptional chain of Message-IDs for proper threading.
attachmentsNoOptional list of attachments. Each can have: 'path' (file path, auto-encodes), OR 'content' (standard base64, not urlsafe) + 'filename'. Optional 'mime_type' (auto-detected from path if not provided).
body_formatNoEmail body format. Use 'plain' for plaintext or 'html' for HTML content.plain
in_reply_toNoOptional Message-ID of the message being replied to.
user_google_emailYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.13.1

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does well: it states that from_email requires the alias to be pre-configured in Gmail settings and falls back to the primary address otherwise, that attachments accept either a file path (auto-encoded) or standard base64, and that reference chains must include all previous Message-IDs. Gaps are the failure modes (invalid thread_id, missing file, oversized attachment) and permission scopes, which go unmentioned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The two-sentence lead and the threading/alias notes are well front-loaded, but the reproduction of the entire input schema as a 13-entry 'Args' block is largely redundant at 92% coverage, and six near-duplicate examples (plain vs HTML, CC/BCC repeated) push length well past what an agent needs to select and call the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter mutation tool with no annotations, the definition covers authentication, alias prerequisites, attachment encoding, threading, and body formats sufficiently to call it correctly, and an output schema exists so the brief 'Returns' line is a bonus. Only error behavior and permission requirements are absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 92%, so the baseline is 3; the description earns above that by documenting the nested attachment dict across two mutually exclusive shapes (path vs content+filename) with mime_type defaults, and by explaining the threading contract for in_reply_to/references that the schema only names. It also clarifies that 'to' may be left empty and how from_name formats the From header.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ('Creates a draft email in the user's Gmail account') and immediately scopes it to two modes: new drafts and reply drafts. This distinguishes it cleanly from the sibling send_gmail_message / send_message tools, which deliver mail rather than staging it, without the agent needing to open a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'when' is clear from the purpose plus six worked examples covering new draft, alias draft, CC/BCC, HTML body, and threaded reply. What is missing is any explicit exclusion or comparison to alternatives (e.g., 'use send_gmail_message to send immediately'), so the agent must infer that boundary from the word 'draft'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools