list_tracked_emails
Retrieve recent tracked emails and their open status to monitor engagement and track email performance.
Instructions
List recent tracked emails with their open status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of results to return (max 200) |
Implementation Reference
- mcp-server.js:94-128 (handler)The implementation of the `list_tracked_emails` tool in `mcp-server.js`. It validates authentication, calls `getDashboard` to retrieve tracking data, and formats the response.
server.tool( 'list_tracked_emails', 'List recent tracked emails with their open status.', { limit: z.number().default(10).describe('Number of results to return (max 200)'), }, async ({ limit }) => { if (!isAuthenticated()) { return { content: [{ type: 'text', text: 'Not authenticated. Run `doubletick login` in the terminal first.' }] }; } const data = await getDashboard(limit); const s = data.stats; let text = `Plan: ${s.plan} · Tracked: ${s.totalTracked} · Open rate: ${s.openRate}%\n`; if (s.weeklyLimit) { text += `Weekly usage: ${s.weeklyUsage}/${s.weeklyLimit}\n`; } if (data.tracks.length === 0) { text += '\nNo tracked emails yet.'; } else { text += '\nRecent tracked emails:\n'; for (const t of data.tracks) { const opened = t.openCount > 0 ? `Opened ${t.openCount}x` : 'Not opened'; const device = t.lastDevice ? ` · ${t.lastDevice}` : ''; text += `\n- ${t.emailSubject || '(no subject)'}\n`; text += ` To: ${t.recipientEmail || '?'} · ${opened}${device}\n`; text += ` ID: ${t.trackingId} · Sent: ${t.createdTimeAgo}\n`; } } return { content: [{ type: 'text', text }] }; } );