Skip to main content
Glama

Notion MCP Server

by Kazy1014
PageId.ts1.31 kB
/** * PageId Value Object - ページIDを表現する値オブジェクト */ export class PageId { private readonly value: string; constructor(value: string) { if (!PageId.isValid(value)) { throw new Error(`Invalid page ID format: ${value}`); } this.value = value; } /** * ページIDの形式が有効かチェック */ static isValid(value: string): boolean { // NotionのIDは32文字の16進数(ハイフンなし)または // UUID形式(8-4-4-4-12) const hexPattern = /^[0-9a-f]{32}$/i; const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; return hexPattern.test(value) || uuidPattern.test(value); } /** * 文字列表現を取得 */ toString(): string { return this.value; } /** * UUID形式に正規化 */ toUUID(): string { if (this.value.includes('-')) { return this.value; } // ハイフンなし形式をUUID形式に変換 return `${this.value.slice(0, 8)}-${this.value.slice(8, 12)}-${this.value.slice(12, 16)}-${this.value.slice(16, 20)}-${this.value.slice(20)}`; } /** * 値オブジェクトの等価性を判定 */ equals(other: PageId): boolean { return this.value.replace(/-/g, '') === other.value.replace(/-/g, ''); } }

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/Kazy1014/notion-mcp'

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