Skip to main content
Glama
cseguinlz

DoubleTick MCP Server

send_tracked_email

Send emails with read tracking via Gmail to monitor when recipients open messages, including open counts and device information.

Instructions

Send an email with read tracking via Gmail. Body accepts markdown (converted to HTML automatically). The email is sent immediately via Gmail API.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesRecipient email address
subjectYesEmail subject
bodyYesEmail body in markdown or HTML
ccNoCC recipients (comma-separated)
bccNoBCC recipients (comma-separated)
htmlNoTreat body as raw HTML (skip markdown conversion)

Implementation Reference

  • The tool "send_tracked_email" is defined and implemented directly within mcp-server.js using server.tool(). It validates inputs using zod, performs markdown-to-HTML conversion, injects a tracking pixel, registers the tracking ID, and sends the email via the imported sendEmail helper.
    server.tool(
      'send_tracked_email',
      'Send an email with read tracking via Gmail. Body accepts markdown (converted to HTML automatically). The email is sent immediately via Gmail API.',
      {
        to: z.string().describe('Recipient email address'),
        subject: z.string().describe('Email subject'),
        body: z.string().describe('Email body in markdown or HTML'),
        cc: z.string().optional().describe('CC recipients (comma-separated)'),
        bcc: z.string().optional().describe('BCC recipients (comma-separated)'),
        html: z.boolean().default(false).describe('Treat body as raw HTML (skip markdown conversion)'),
      },
      async ({ to, subject, body, cc, bcc, html }) => {
        if (!isAuthenticated()) {
          return { content: [{ type: 'text', text: 'Not authenticated. Run `doubletick login` in the terminal first.' }] };
        }
    
        // Convert body
        let htmlBody;
        if (html) {
          htmlBody = body;
        } else {
          htmlBody = await marked(body);
          if (!htmlBody.includes('<html')) {
            htmlBody = `<!DOCTYPE html><html><body>${htmlBody}</body></html>`;
          }
        }
    
        // Inject pixel
        const trackingId = generateTrackingId();
        htmlBody = injectPixel(htmlBody, trackingId);
    
        // Register track
        await registerTrack({ trackingId, recipientEmail: to, emailSubject: subject });
    
        // Send via Gmail API
        const result = await sendEmail({ to, subject, htmlBody, cc, bcc });
        return {
          content: [{
            type: 'text',
            text: `Email sent and tracking.\n\nTo: ${to}\nSubject: ${subject}\nTracking ID: ${trackingId}\n\nCheck status with check_tracking_status tool.`,
          }],
        };
      }
    );

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/cseguinlz/double-tick-mcp-server'

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