Skip to main content
Glama

send_email

Send emails from specified accounts with support for attachments, CC/BCC, and threaded replies to maintain conversation context in email clients.

Instructions

Send an email using the specified account. Supports replying to emails with proper threading when in_reply_to is provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_nameYesThe name of the email account to send from.
recipientsYesA list of recipient email addresses.
subjectYesThe subject of the email.
bodyYesThe body of the email.
ccNoA list of CC email addresses.
bccNoA list of BCC email addresses.
htmlNoWhether to send the email as HTML (True) or plain text (False).
attachmentsNoA list of absolute file paths to attach to the email. Supports common file types (documents, images, archives, etc.).
in_reply_toNoMessage-ID of the email being replied to. Enables proper threading in email clients.
referencesNoSpace-separated Message-IDs for the thread chain. Usually includes in_reply_to plus ancestors.

Implementation Reference

  • MCP tool definition for 'send_email', including registration via @mcp.tool decorator, input schema via Pydantic Field annotations, and handler logic that dispatches to provider-specific email handler.
    @mcp.tool( description="Send an email using the specified account. Supports replying to emails with proper threading when in_reply_to is provided.", ) async def send_email( account_name: Annotated[str, Field(description="The name of the email account to send from.")], recipients: Annotated[list[str], Field(description="A list of recipient email addresses.")], subject: Annotated[str, Field(description="The subject of the email.")], body: Annotated[str, Field(description="The body of the email.")], cc: Annotated[ list[str] | None, Field(default=None, description="A list of CC email addresses."), ] = None, bcc: Annotated[ list[str] | None, Field(default=None, description="A list of BCC email addresses."), ] = None, html: Annotated[ bool, Field(default=False, description="Whether to send the email as HTML (True) or plain text (False)."), ] = False, attachments: Annotated[ list[str] | None, Field( default=None, description="A list of absolute file paths to attach to the email. Supports common file types (documents, images, archives, etc.).", ), ] = None, in_reply_to: Annotated[ str | None, Field( default=None, description="Message-ID of the email being replied to. Enables proper threading in email clients.", ), ] = None, references: Annotated[ str | None, Field( default=None, description="Space-separated Message-IDs for the thread chain. Usually includes in_reply_to plus ancestors.", ), ] = None, ) -> str: handler = dispatch_handler(account_name) await handler.send_email( recipients, subject, body, cc, bcc, html, attachments, in_reply_to, references, ) recipient_str = ", ".join(recipients) attachment_info = f" with {len(attachments)} attachment(s)" if attachments else "" return f"Email sent successfully to {recipient_str}{attachment_info}"

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/ai-zerolab/mcp-email-server'

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