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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search query string | |
| filter | No | Optional filter criteria | |
| sort | No | Optional sort criteria | |
| start_cursor | No | Cursor for pagination | |
| page_size | No | Number of results per page |
Implementation Reference
- server.js:612-642 (handler)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 } } } } - server.js:285-311 (schema)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 } } }