Skip to main content
Glama

search

Find Notion pages and databases using search queries, filters, and sorting to locate specific content within your workspace.

Instructions

Search Notion for pages or databases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch query string
filterNoOptional filter criteria
sortNoOptional sort criteria
start_cursorNoCursor for pagination
page_sizeNoNumber of results per page

Implementation Reference

  • Handler for the 'search' tool: destructures input arguments, conditionally builds searchParams object, calls Notion's search API, and returns the response as text content.
    else if (name === "search") { const { query, filter, sort, start_cursor, page_size } = args; const searchParams = { query: query || "", page_size: page_size || 100, }; if (filter) { searchParams.filter = filter; } if (sort) { searchParams.sort = sort; } if (start_cursor) { searchParams.start_cursor = start_cursor; } const response = await notion.search(searchParams); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
  • server.js:282-312 (registration)
    Registration of the 'search' tool in the tools/list handler response. Includes name, description, and detailed inputSchema defining parameters for the Notion search API.
    { name: "search", description: "Search Notion for pages or databases", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query string", default: "" }, filter: { type: "object", description: "Optional filter criteria" }, sort: { type: "object", description: "Optional sort criteria" }, start_cursor: { type: "string", description: "Cursor for pagination" }, page_size: { type: "number", description: "Number of results per page", default: 100 } } } }
  • Input schema for the 'search' tool, specifying properties like query, filter, sort, pagination options matching the Notion search API.
    inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query string", default: "" }, filter: { type: "object", description: "Optional filter criteria" }, sort: { type: "object", description: "Optional sort criteria" }, start_cursor: { type: "string", description: "Cursor for pagination" }, page_size: { type: "number", description: "Number of results per page", default: 100 } } }

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/Sjotie/notionMCP'

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