Skip to main content
Glama
client.ts1.24 kB
import { Client } from '@notionhq/client'; import { CreatePageArgs, RetrievePageArgs, UpdatePageArgs, RetrievePagePropertyArgs, } from './types.js'; export class NotionClient { private client: Client; constructor(apiKey: string, version?: string) { this.client = new Client({ auth: apiKey, notionVersion: version || '2022-06-28' }); } async createPage(args: CreatePageArgs) { return await this.client.pages.create(args as any); } async retrievePage(args: RetrievePageArgs) { const { page_id, filter_properties } = args; return await this.client.pages.retrieve({ page_id, ...(filter_properties && { filter_properties }) }); } async updatePage(args: UpdatePageArgs) { return await this.client.pages.update(args as any); } async retrievePageProperty(args: RetrievePagePropertyArgs) { const { page_id, property_id, page_size, start_cursor } = args; return await this.client.pages.properties.retrieve({ page_id, property_id, ...(page_size && { page_size }), ...(start_cursor && { start_cursor }) }); } }

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

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