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) }],
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'modify existing page content' which implies a mutation operation, but it doesn't disclose critical traits like permission requirements, whether changes are reversible, potential side effects (e.g., overwriting content), or error handling. This is a significant gap for a mutation tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence in Korean ('기존 페이지 내용 수정') that directly states the tool's purpose with zero waste. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (mutation operation with 3 parameters, nested objects, and no output schema), the description is incomplete. It lacks information on behavioral traits, output expectations, and usage guidelines, which are crucial for an agent to invoke this tool correctly in context with siblings like 'append_to_page' and 'delete_page'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters (path, content, properties). The description adds no additional meaning beyond what the schema provides—it doesn't explain parameter interactions, format details, or usage examples. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description '기존 페이지 내용 수정' (modify existing page content) clearly states the verb (modify) and resource (page content), but it's vague about scope and doesn't distinguish from siblings like 'append_to_page' or 'create_page'. It's adequate but lacks specificity about what 'modify' entails compared to other page operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'append_to_page' (for adding content) or 'create_page' (for new pages). The description implies it's for existing pages but doesn't clarify prerequisites, exclusions, or typical use cases, leaving the agent to infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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