get_account_summary
Get aggregate mailbox statistics and a high-level status overview of your Fastmail account. Understand mailbox health and activity without reviewing individual emails.
Instructions
Get an overall Fastmail account summary with aggregate mailbox statistics. Use when the user wants a high-level status view of the mailbox rather than raw email lists. Do not use for message content or search.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.ts:363-366 (handler)The case handler in the MCP server's CallToolRequestSchema switch statement that dispatches 'get_account_summary' to client.getAccountSummary() and returns the result as JSON text.
case 'get_account_summary': { const summary = await client.getAccountSummary(); return { content: [{ type: 'text', text: JSON.stringify(summary, null, 2) }] }; } - src/tool-definitions.ts:694-703 (schema)Tool definition for 'get_account_summary' registered as a readTool with title 'Get Account Summary' and an empty input schema (no parameters required).
readTool( 'get_account_summary', 'Get Account Summary', description( 'Get an overall Fastmail account summary with aggregate mailbox statistics.', 'Use when the user wants a high-level status view of the mailbox rather than raw email lists.', 'Do not use for message content or search.', ), emptySchema, ), - src/mcp-server.ts:410-417 (registration)Registration of 'get_account_summary' in the list of available email functions reported to the client.
email: { available: true, functions: [ 'list_mailboxes', 'list_emails', 'get_email', 'send_email', 'create_draft', 'search_emails', 'get_recent_emails', 'mark_email_read', 'delete_email', 'move_email', 'get_email_attachments', 'download_attachment', 'advanced_search', 'get_thread', 'get_mailbox_stats', 'get_account_summary', 'bulk_mark_read', 'bulk_move', 'bulk_delete', 'add_labels', 'remove_labels', 'bulk_add_labels', 'bulk_remove_labels', - src/jmap-client.ts:1112-1138 (handler)The actual business logic: fetches session, mailboxes, and identities; then aggregates totals (totalEmails, unreadEmails, totalThreads, unreadThreads) across all mailboxes and returns a summary with accountId, mailboxCount, identityCount, totals, and per-mailbox details.
async getAccountSummary(): Promise<any> { const session = await this.getSession(); const mailboxes = await this.getMailboxes(); const identities = await this.getIdentities(); // Calculate totals const totals = mailboxes.reduce((acc, mb) => ({ totalEmails: acc.totalEmails + (mb.totalEmails || 0), unreadEmails: acc.unreadEmails + (mb.unreadEmails || 0), totalThreads: acc.totalThreads + (mb.totalThreads || 0), unreadThreads: acc.unreadThreads + (mb.unreadThreads || 0) }), { totalEmails: 0, unreadEmails: 0, totalThreads: 0, unreadThreads: 0 }); return { accountId: session.accountId, mailboxCount: mailboxes.length, identityCount: identities.length, ...totals, mailboxes: mailboxes.map(mb => ({ id: mb.id, name: mb.name, role: mb.role, totalEmails: mb.totalEmails || 0, unreadEmails: mb.unreadEmails || 0 })) }; }