Skip to main content
Glama

Notion MCP Server

by yihaoWang
database-handler.ts663 B
import { IToolHandler, INotionService, ToolResponse, QueryDatabaseParams } from '../types.js'; import { Validator } from '../errors.js'; export class QueryDatabaseHandler implements IToolHandler { constructor(private notionService: INotionService) {} async handle(args: QueryDatabaseParams): Promise<ToolResponse> { Validator.validateString(args.databaseId, 'databaseId'); const result = await this.notionService.queryDatabase( args.databaseId, args.filter, args.sorts ); return { content: [ { type: "text", text: JSON.stringify(result.results, null, 2), }, ], }; } }

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

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