Skip to main content
Glama

Notion MCP Server

search.ts1.53 kB
import { z } from "zod"; import { notionClient } from "../../notion/client"; import { defineTool, InferToolHandlerInput } from "../../utils/defineTool"; const searchSchema = { query: z .string() .optional() .describe("The search query string to match against page content"), sort: z .object({ timestamp: z .literal("last_edited_time") .describe("Sort by last edited time"), direction: z.enum(["ascending", "descending"]).describe("Sort direction"), }) .optional() .describe("Sort options for the search results"), start_cursor: z .string() .optional() .describe( "Cursor to start from for pagination, use from the previous search results to get next page." ), page_size: z .number() .min(1) .max(100) .default(10) .optional() .describe("Number of results to return per page (1-100)"), filter: z .object({ property: z.literal("object").describe("Property to filter on"), value: z .enum(["page", "database"]) .describe( "Defines if you want to filter for pages or database entries" ), }) .optional() .describe("Filter options for the search results"), }; export const NOTION_SEARCH_TOOL = defineTool((z) => ({ name: "notion_search", description: "Search through Notion with fine-grained control.", inputSchema: searchSchema, handler: async (input: InferToolHandlerInput<typeof searchSchema>) => { return await notionClient.search(input); }, }));

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

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