Skip to main content
Glama
coji
by coji

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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; } );
  • 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), }; }
  • 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; }>; }

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/coji/journal-mcp'

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