get_daily_summary
Retrieve summary statistics for journal entries to analyze daily patterns and insights from personal journal content.
Instructions
Get summary statistics for journal entries
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp-server.ts:230-262 (handler)The handler and registration for the 'get_daily_summary' tool. It takes no input parameters, calls getStats() to retrieve journal statistics, formats them into a markdown response, and returns it as tool output.this.server.tool( 'get_daily_summary', 'Get summary statistics for journal entries', async () => { const stats = await getStats(); let response = `π Journal Summary\n\n`; response += `**Total Entries:** ${stats.totalEntries}\n`; response += `**Total Days:** ${stats.totalFiles}\n`; if (stats.dateRange.earliest && stats.dateRange.latest) { response += `**Date Range:** ${stats.dateRange.earliest} to ${stats.dateRange.latest}\n`; } response += `\n**Top Tags:**\n`; if (stats.topTags.length === 0) { response += 'No tags found.\n'; } else { for (const { tag, count } of stats.topTags) { response += `β’ ${tag} (${count})\n`; } } return { content: [ { type: 'text', text: response, }, ], } satisfies CallToolResult; } );
- src/journal/manager.ts:411-437 (helper)Core helper function getStats() that computes comprehensive journal statistics by scanning all entries, aggregating counts, date range, and top tags.export async function getStats(): Promise<JournalStats> { const result = await searchEntries(); const files = result.entries; if (files.length === 0) { return { totalEntries: 0, totalFiles: 0, dateRange: { earliest: '', latest: '' }, topTags: [], }; } const totalEntries = files.reduce((sum, file) => sum + file.entries_count, 0); const dates = files.map((f) => f.date).sort(); const topTags = await listTags(); return { totalEntries, totalFiles: files.length, dateRange: { earliest: dates[0], latest: dates[dates.length - 1], }, topTags: topTags.slice(0, 10), }; }
- src/journal/types.ts:37-48 (schema)Type definition for JournalStats, the data structure used by getStats() and rendered in the tool's output.export interface JournalStats { totalEntries: number; totalFiles: number; dateRange: { earliest: string; latest: string; }; topTags: Array<{ tag: string; count: number; }>; }