Skip to main content
Glama

create_page

Create new pages in Logseq with content and optional properties to organize your knowledge graph directly from AI assistants.

Instructions

새 페이지 생성. Logseq 프로퍼티 포함 가능

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes생성할 페이지 이름
contentYes페이지 내용
propertiesNoLogseq 프로퍼티 (선택)

Implementation Reference

  • Core handler function that creates a new Logseq page by writing a .md file to the pages directory after performing security validations (name, content size, path traversal, symlink checks).
    async createPage(name: string, content: string, properties?: Record<string, unknown>): Promise<Page> {
      // 보안 검증: 화이트리스트 기반 이름 검증
      this.validatePageName(name);
    
      const filePath = join(this.pagesPath, `${name}.md`);
      this.validatePath(filePath);
    
      // 보안 검증: 콘텐츠 크기 제한 (DoS 방지)
      this.validateContentSize(content);
    
      // Ensure pages directory exists
      await mkdir(this.pagesPath, { recursive: true });
    
      // 보안 검증: 심링크 공격 방지
      await this.checkSymlink(filePath);
    
      const fullContent = this.buildContent(content, properties);
    
      // 보안: TOCTOU 방지 - 'wx' 플래그로 원자적 생성 (파일 존재 시 실패)
      try {
        await writeFile(filePath, fullContent, { encoding: 'utf-8', flag: 'wx' });
      } catch (e: any) {
        if (e.code === 'EEXIST') {
          throw new Error(`Page already exists: ${name}`);
        }
        throw e;
      }
    
      return this.readPage(name);
    }
  • MCP CallToolRequest handler switch case that validates input arguments using Zod schema and delegates execution to GraphService.createPage, returning the result as JSON.
    case 'create_page': {
      const { name: pageName, content, properties } = CreatePageSchema.parse(args);
      const page = await graph.createPage(pageName, content, properties);
      return {
        content: [{ type: 'text', text: JSON.stringify(page, null, 2) }],
      };
    }
  • Zod schema used for runtime validation of create_page tool arguments within the tool handler.
    const CreatePageSchema = z.object({
      name: z.string().max(MAX_NAME_LENGTH).describe('생성할 페이지 이름'),
      content: z.string().max(MAX_CONTENT_LENGTH).describe('페이지 내용'),
      properties: z.record(z.string().max(10000)).optional().describe('Logseq 프로퍼티 (선택, 문자열 값만)'),
    });
  • src/index.ts:132-144 (registration)
    Tool registration in the TOOLS array provided to ListToolsRequest, including JSON Schema for input validation and tool description.
    {
      name: 'create_page',
      description: '새 페이지 생성. Logseq 프로퍼티 포함 가능',
      inputSchema: {
        type: 'object' as const,
        properties: {
          name: { type: 'string', description: '생성할 페이지 이름' },
          content: { type: 'string', description: '페이지 내용' },
          properties: { type: 'object', description: 'Logseq 프로퍼티 (선택)' },
        },
        required: ['name', 'content'],
      },
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It states this creates a new page but doesn't disclose important traits like: whether this requires specific permissions, what happens if a page with the same name already exists, whether changes are permanent/destructive, or what the response format looks like. The Logseq property mention is useful but insufficient for a mutation tool.

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

Conciseness4/5

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

The description is extremely concise with just two short phrases. It's front-loaded with the core purpose ('새 페이지 생성') followed by an important capability detail. While efficient, it might be too terse given the tool's complexity as a creation operation.

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?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what happens on success/failure, return values, error conditions, or important behavioral constraints. Given 3 parameters (including a nested object) and the creation nature, more context about permissions, idempotency, and response format is needed.

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 three parameters thoroughly. The description adds minimal value beyond the schema - it mentions Logseq properties correspond to the 'properties' parameter, but doesn't provide additional semantic context about format, constraints, or usage patterns.

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

Purpose4/5

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

The description clearly states the action ('새 페이지 생성' - create new page) and resource (page), with the additional detail that it can include Logseq properties. It distinguishes from siblings like 'append_to_page' (modifies existing) and 'create_journal' (different resource type). However, it doesn't explicitly contrast with 'update_page' which might also create pages in some contexts.

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?

The description provides no guidance on when to use this tool versus alternatives like 'create_journal' for journal pages or 'update_page' for modifying existing pages. It mentions Logseq properties but doesn't explain when this capability is relevant versus using simpler creation methods.

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