delete_page
Remove a page from your Logseq knowledge graph by specifying its path or name to manage your workspace content.
Instructions
페이지 삭제
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | 삭제할 페이지 경로 또는 이름 |
Implementation Reference
- src/index.ts:282-288 (handler)MCP tool handler for 'delete_page': validates input using DeletePageSchema, calls GraphService.deletePage(path), and returns a success message.case 'delete_page': { const { path } = DeletePageSchema.parse(args); await graph.deletePage(path); return { content: [{ type: 'text', text: `페이지 삭제 완료: ${path}` }], }; }
- src/index.ts:76-78 (schema)Zod schema defining the input for delete_page tool: requires a 'path' string with maximum length limit.const DeletePageSchema = z.object({ path: z.string().max(MAX_PATH_LENGTH).describe('삭제할 페이지 경로 또는 이름'), });
- src/index.ts:158-168 (registration)Tool registration in TOOLS array: defines name 'delete_page', description, and inputSchema for MCP server.{ name: 'delete_page', description: '페이지 삭제', inputSchema: { type: 'object' as const, properties: { path: { type: 'string', description: '삭제할 페이지 경로 또는 이름' }, }, required: ['path'], }, },
- src/graph.ts:243-247 (helper)Core deletion logic in GraphService: resolves the full file path, performs security checks, and deletes the page file using fs.unlink.async deletePage(pathOrName: string): Promise<void> { const filePath = await this.resolvePath(pathOrName); await this.checkSymlink(filePath); // 보안: 심링크 공격 방지 await unlink(filePath); }