Skip to main content
Glama

send_email

Send emails using markdown formatting that automatically converts to HTML. Includes oversight features for review and approval when required.

Instructions

Send an email from your MultiMail address. The body is written in markdown and automatically converted to formatted HTML for delivery. If the mailbox is in read_only mode, this returns a 403 error with upgrade instructions — use request-upgrade to ask the operator for more autonomy. If the mailbox uses gated oversight, the response status will be 'pending_approval' — this means the email is queued for human review. Do not retry or resend when you see pending_approval.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient email addresses
subjectYesEmail subject line
markdownYesEmail body in markdown format
ccNoCC email addresses
mailbox_idNoMailbox ID (uses MULTIMAIL_MAILBOX_ID env var if not provided)

Implementation Reference

  • Complete send_email tool implementation including registration, schema definition, and handler function. The handler validates the mailbox_id, constructs the request body with to, subject, markdown, and optional cc fields, then calls the MultiMail API to send the email.
    // Tool 2: send_email
    server.tool(
      "send_email",
      "Send an email from your MultiMail address. The body is written in markdown and automatically converted to formatted HTML for delivery. If the mailbox is in read_only mode, this returns a 403 error with upgrade instructions — use request-upgrade to ask the operator for more autonomy. If the mailbox uses gated oversight, the response status will be 'pending_approval' — this means the email is queued for human review. Do not retry or resend when you see pending_approval.",
      {
        to: z.array(z.string().email()).describe("Recipient email addresses"),
        subject: z.string().describe("Email subject line"),
        markdown: z.string().describe("Email body in markdown format"),
        cc: z.array(z.string().email()).optional().describe("CC email addresses"),
        mailbox_id: z.string().optional().describe("Mailbox ID (uses MULTIMAIL_MAILBOX_ID env var if not provided)"),
      },
      async ({ to, subject, markdown, cc, mailbox_id }) => {
        const id = getMailboxId(mailbox_id);
        const body: Record<string, unknown> = { to, subject, markdown };
        if (cc?.length) body.cc = cc;
        const data = await apiCall("POST", `/v1/mailboxes/${encodeURIComponent(id)}/send`, body);
        return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
      }
    );
  • Zod schema definition for send_email tool parameters: to (required array of emails), subject (required string), markdown (required string), cc (optional array of emails), and mailbox_id (optional string).
    {
      to: z.array(z.string().email()).describe("Recipient email addresses"),
      subject: z.string().describe("Email subject line"),
      markdown: z.string().describe("Email body in markdown format"),
      cc: z.array(z.string().email()).optional().describe("CC email addresses"),
      mailbox_id: z.string().optional().describe("Mailbox ID (uses MULTIMAIL_MAILBOX_ID env var if not provided)"),
    },
  • The actual handler function for send_email that retrieves the mailbox_id, builds the request body, and makes a POST API call to /v1/mailboxes/{id}/send endpoint.
    async ({ to, subject, markdown, cc, mailbox_id }) => {
      const id = getMailboxId(mailbox_id);
      const body: Record<string, unknown> = { to, subject, markdown };
      if (cc?.length) body.cc = cc;
      const data = await apiCall("POST", `/v1/mailboxes/${encodeURIComponent(id)}/send`, body);
      return { content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }] };
    }

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/multimail-dev/multi-mail'

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