read_page
Retrieve the full content and metadata of a specific page in your Logseq knowledge graph to access information directly.
Instructions
특정 페이지의 전체 내용과 메타데이터 조회
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 페이지 경로 또는 이름 (예: "pages/note" 또는 "note") |
Implementation Reference
- src/index.ts:258-264 (handler)MCP tool call handler: parses arguments using schema and delegates to GraphService.readPage, returns JSON serialized pagecase 'read_page': { const { path } = ReadPageSchema.parse(args); const page = await graph.readPage(path); return { content: [{ type: 'text', text: JSON.stringify(page, null, 2) }], }; }
- src/index.ts:60-62 (schema)Zod input validation schema for read_page toolconst ReadPageSchema = z.object({ path: z.string().max(MAX_PATH_LENGTH).describe('페이지 경로 또는 이름 (예: "pages/note" 또는 "note")'), });
- src/index.ts:122-131 (registration)Tool registration entry in TOOLS array defining name, description, and JSON input schemaname: 'read_page', description: '특정 페이지의 전체 내용과 메타데이터 조회', inputSchema: { type: 'object' as const, properties: { path: { type: 'string', description: '페이지 경로 또는 이름 (예: "pages/note" 또는 "note")' }, }, required: ['path'], }, },
- src/graph.ts:132-160 (helper)GraphService.readPage: resolves file path, reads and parses content, extracts tags/links/backlinks/properties, returns Page objectasync readPage(pathOrName: string): Promise<Page> { const filePath = await this.resolvePath(pathOrName); await this.checkSymlink(filePath); // 심링크 공격 방지 const content = await readFile(filePath, 'utf-8'); const name = basename(filePath, '.md'); const isJournal = filePath.includes('/journals/'); const { properties, body } = this.parseProperties(content); const stats = await stat(filePath); // Get backlinks const allPages = await this.collectAllPages(); const backlinks = allPages .filter(p => p.links.includes(name)) .map(p => p.name); return { path: filePath.replace(this.graphPath + '/', ''), name, content: body, properties, tags: this.extractTags(content), links: this.extractLinks(content), backlinks, isJournal, createdAt: stats.birthtime, modifiedAt: stats.mtime, }; }