Skip to main content
Glama

notion-mcp-server

searchPage.ts890 B
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { notion } from "../services/notion.js"; import { handleNotionError } from "../utils/error.js"; import { SearchPagesParams } from "../types/page.js"; export async function searchPages( params: SearchPagesParams ): Promise<CallToolResult> { try { const response = await notion.search({ query: params.query || "", sort: params.sort, start_cursor: params.start_cursor, page_size: params.page_size || 10, }); const resultsText = JSON.stringify(response, null, 2); return { content: [ { type: "text", text: `Found ${response.results.length} results. ${ response.has_more ? "More results available." : "" }\n\n${resultsText}`, }, ], }; } catch (error) { return handleNotionError(error); } }

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

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