Skip to main content
Glama

google_gmail_draft_email

Create and manage draft emails directly in Gmail by specifying recipients, subject, body, and optional CC/BCC. Supports plain text or HTML content for efficient email drafting.

Instructions

Create a draft email

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bccNoBCC recipients email addresses
bodyYesEmail body content (can be plain text or HTML)
ccNoCC recipients email addresses
isHtmlNoWhether the body contains HTML
subjectYesEmail subject
toYesRecipients email addresses

Implementation Reference

  • The main handler function that executes the tool: validates arguments using isDraftEmailArgs and delegates to GoogleGmail.draftEmail
    export async function handleGmailDraftEmail( args: any, googleGmailInstance: GoogleGmail ) { if (!isDraftEmailArgs(args)) { throw new Error("Invalid arguments for google_gmail_draft_email"); } const { to, subject, body, cc, bcc, isHtml, attachments } = args; const result = await googleGmailInstance.draftEmail( to, subject, body, cc, bcc, isHtml, attachments ); return { content: [{ type: "text", text: result }], isError: false, }; }
  • Input schema definition for the google_gmail_draft_email tool, defining parameters like to, subject, body, attachments etc.
    export const DRAFT_EMAIL_TOOL: Tool = { name: "google_gmail_draft_email", description: "Create a draft email", inputSchema: { type: "object", properties: { to: { type: "array", items: { type: "string" }, description: "Recipients email addresses", }, subject: { type: "string", description: "Email subject", }, body: { type: "string", description: "Email body content (can be plain text or HTML)", }, cc: { type: "array", items: { type: "string" }, description: "CC recipients email addresses", }, bcc: { type: "array", items: { type: "string" }, description: "BCC recipients email addresses", }, isHtml: { type: "boolean", description: "Whether the body contains HTML", }, attachments: { type: "array", items: { type: "object", properties: { filePath: { type: "string", description: "Local file path to attach (e.g., '/Users/username/Documents/file.pdf')", }, driveFileId: { type: "string", description: "Google Drive file ID to attach (alternative to filePath)", }, filename: { type: "string", description: "Custom filename for the attachment (optional, will use original filename if not provided)", }, mimeType: { type: "string", description: "MIME type of the attachment (optional, will be auto-detected)", }, }, oneOf: [{ required: ["filePath"] }, { required: ["driveFileId"] }], }, description: "Array of attachments to include with the email. Provide either filePath for local files or driveFileId for Google Drive files.", }, }, required: ["to", "subject", "body"], }, };
  • Registration/dispatch: switch case in the MCP server request handler that routes 'call tool' requests for this tool name to the gmail handler.
    case "google_gmail_draft_email": return await gmailHandlers.handleGmailDraftEmail( args, googleGmailInstance );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vakharwalad23/google-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server