Skip to main content
Glama

update_page

Modify existing Logseq page content and properties directly within your knowledge graph to keep information current and organized.

Instructions

기존 페이지 내용 수정

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes수정할 페이지 경로 또는 이름
contentYes새로운 페이지 내용
propertiesNoLogseq 프로퍼티 (선택)

Implementation Reference

  • Core handler function in GraphService that performs the page update by validating input, resolving path, building content with properties, writing to file, and returning the updated page.
    async updatePage(pathOrName: string, content: string, properties?: Record<string, unknown>): Promise<Page> { // 보안 검증: 콘텐츠 크기 제한 (DoS 방지) this.validateContentSize(content); const filePath = await this.resolvePath(pathOrName); await this.checkSymlink(filePath); // 심링크 공격 방지 const fullContent = this.buildContent(content, properties); await writeFile(filePath, fullContent, 'utf-8'); return this.readPage(pathOrName); }
  • src/index.ts:145-157 (registration)
    MCP tool registration defining the name, description, and input schema for the update_page tool.
    { name: 'update_page', description: '기존 페이지 내용 수정', inputSchema: { type: 'object' as const, properties: { path: { type: 'string', description: '수정할 페이지 경로 또는 이름' }, content: { type: 'string', description: '새로운 페이지 내용' }, properties: { type: 'object', description: 'Logseq 프로퍼티 (선택)' }, }, required: ['path', 'content'], }, },
  • Zod validation schema for parsing and validating arguments passed to the update_page tool.
    const UpdatePageSchema = z.object({ path: z.string().max(MAX_PATH_LENGTH).describe('수정할 페이지 경로 또는 이름'), content: z.string().max(MAX_CONTENT_LENGTH).describe('새로운 페이지 내용'), properties: z.record(z.string().max(10000)).optional().describe('Logseq 프로퍼티 (선택, 문자열 값만)'), });
  • Top-level handler in the MCP server that parses arguments using the schema and delegates to GraphService.updatePage.
    case 'update_page': { const { path, content, properties } = UpdatePageSchema.parse(args); const page = await graph.updatePage(path, content, properties); return { content: [{ type: 'text', text: JSON.stringify(page, null, 2) }], }; }

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/dearcloud09/logseq-mcp'

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