Skip to main content
Glama

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
NameRequiredDescriptionDefault
pathYes페이지 경로 또는 이름 (예: "pages/note" 또는 "note")

Implementation Reference

  • MCP tool call handler: parses arguments using schema and delegates to GraphService.readPage, returns JSON serialized page
    case 'read_page': {
      const { path } = ReadPageSchema.parse(args);
      const page = await graph.readPage(path);
      return {
        content: [{ type: 'text', text: JSON.stringify(page, null, 2) }],
      };
    }
  • Zod input validation schema for read_page tool
    const 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 schema
      name: 'read_page',
      description: '특정 페이지의 전체 내용과 메타데이터 조회',
      inputSchema: {
        type: 'object' as const,
        properties: {
          path: { type: 'string', description: '페이지 경로 또는 이름 (예: "pages/note" 또는 "note")' },
        },
        required: ['path'],
      },
    },
  • GraphService.readPage: resolves file path, reads and parses content, extracts tags/links/backlinks/properties, returns Page object
    async 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,
      };
    }

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