get_journal
Retrieve journal entries from your Logseq knowledge graph for today or a specific date to access daily notes without manual searching.
Instructions
오늘 또는 특정 날짜의 저널 페이지 조회
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | 날짜 (YYYY-MM-DD, 기본값: 오늘) |
Implementation Reference
- src/index.ts:322-333 (handler)MCP tool handler for 'get_journal': parses arguments using GetJournalSchema, calls graph.getJournalPage(date), returns JSON of page or error message if not found.case 'get_journal': { const { date } = GetJournalSchema.parse(args); const page = await graph.getJournalPage(date); if (!page) { return { content: [{ type: 'text', text: '저널 페이지를 찾을 수 없습니다.' }], }; } return { content: [{ type: 'text', text: JSON.stringify(page, null, 2) }], }; }
- src/index.ts:100-102 (schema)Zod schema for validating input to get_journal tool: optional date string (YYYY-MM-DD).const GetJournalSchema = z.object({ date: z.string().max(10).optional().describe('날짜 (YYYY-MM-DD, 기본값: 오늘)'), });
- src/index.ts:216-225 (registration)Registration of 'get_journal' tool in TOOLS array, including name, description, and JSON input schema.{ name: 'get_journal', description: '오늘 또는 특정 날짜의 저널 페이지 조회', inputSchema: { type: 'object' as const, properties: { date: { type: 'string', description: '날짜 (YYYY-MM-DD, 기본값: 오늘)' }, }, }, },
- src/graph.ts:413-431 (helper)Core helper method getJournalPage in GraphService: computes journal filename from date (YYYY-MM-DD to YYYY_MM_DD.md), checks existence, returns Page via readPage or null.async getJournalPage(date?: string): Promise<Page | null> { const targetDate = date || this.getTodayString(); // Validate date format (YYYY-MM-DD only) if (date && !/^\d{4}-\d{2}-\d{2}$/.test(date)) { throw new Error('Invalid date format: use YYYY-MM-DD'); } const fileName = targetDate.replace(/-/g, '_') + '.md'; const filePath = join(this.journalsPath, fileName); this.validatePath(filePath); try { await stat(filePath); return this.readPage(`journals/${fileName}`); } catch { return null; } }