get_recent_entries
Retrieve recent journal entries from your personal journal to review or analyze past content, with customizable limits for focused browsing.
Instructions
Get the most recent journal entries
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of recent entries to retrieve (default 10) |
Implementation Reference
- src/mcp-server.ts:121-155 (handler)MCP server tool registration for 'get_recent_entries', including input schema (limit parameter) and handler function that fetches entries using getRecentEntries helper and formats a markdown-formatted text response.this.server.tool( 'get_recent_entries', 'Get the most recent journal entries', { limit: z .number() .optional() .describe('Number of recent entries to retrieve (default 10)'), }, async (args) => { const entries = await getRecentEntries(args.limit); let response = `π Recent Journal Entries (${entries.length})\n\n`; for (const file of entries) { response += `**${file.date}** - ${file.entries_count} entries\n`; response += `Tags: ${file.tags.join(', ') || 'None'}\n`; for (const entry of file.entries) { response += `\nπ ${entry.timestamp} - ${entry.title}\n`; response += `${entry.content}\n`; } response += '\n---\n\n'; } return { content: [ { type: 'text', text: response, }, ], } satisfies CallToolResult; } );
- src/mcp-server.ts:124-129 (schema)Zod input schema defining the optional 'limit' parameter for the tool.{ limit: z .number() .optional() .describe('Number of recent entries to retrieve (default 10)'), },
- src/journal/manager.ts:365-368 (helper)Core helper function that implements getRecentEntries by invoking searchEntries with the given limit and returning the recent JournalFile entries.export async function getRecentEntries(limit = 10): Promise<JournalFile[]> { const result = await searchEntries({ limit }); return result.entries; }
- src/mcp-server.ts:121-123 (registration)Tool registration call specifying the tool name and description.this.server.tool( 'get_recent_entries', 'Get the most recent journal entries',
- src/mcp-server.ts:5-11 (helper)Import of the getRecentEntries helper function from journal manager.addEntry, searchEntries, getRecentEntries, listTags, getEntryByDate, getStats, } from './journal/manager.js';