Skip to main content
Glama

notion_search

Search for pages or databases by title in Notion workspaces to quickly find specific content and organize information.

Instructions

Search pages or databases by title in Notion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoText to search for in page or database titles
filterNoFilter results by object type (page or database)
sortNoSort order of results
start_cursorNoPagination start cursor
page_sizeNoNumber of results to return (max 100).
formatNoSpecify the response format. 'json' returns the original data structure, 'markdown' returns a more readable format. Use 'markdown' when the user only needs to read the page and isn't planning to write or modify it. Use 'json' when the user needs to read the page with the intention of writing to or modifying it.markdown

Implementation Reference

  • Core handler implementing the Notion search API call by building the request body from tool arguments and POSTing to /search endpoint.
    async search(
      query?: string,
      filter?: { property: string; value: string },
      sort?: {
        direction: "ascending" | "descending";
        timestamp: "last_edited_time";
      },
      start_cursor?: string,
      page_size?: number
    ): Promise<ListResponse> {
      const body: Record<string, any> = {};
      if (query) body.query = query;
      if (filter) body.filter = filter;
      if (sort) body.sort = sort;
      if (start_cursor) body.start_cursor = start_cursor;
      if (page_size) body.page_size = page_size;
    
      const response = await fetch(`${this.baseUrl}/search`, {
        method: "POST",
        headers: this.headers,
        body: JSON.stringify(body),
      });
    
      return response.json();
    }
  • Server-side dispatch for notion_search tool: casts request arguments and invokes the client search method.
    case "notion_search": {
      const args = request.params.arguments as unknown as args.SearchArgs;
      response = await notionClient.search(
        args.query,
        args.filter,
        args.sort,
        args.start_cursor,
        args.page_size
      );
      break;
    }
  • MCP tool schema for notion_search, defining name, description, and input validation schema.
    export const searchTool: Tool = {
      name: "notion_search",
      description: "Search pages or databases by title in Notion",
      inputSchema: {
        type: "object",
        properties: {
          query: {
            type: "string",
            description: "Text to search for in page or database titles",
          },
          filter: {
            type: "object",
            description: "Filter results by object type (page or database)",
            properties: {
              property: {
                type: "string",
                description: "Must be 'object'",
              },
              value: {
                type: "string",
                description: "Either 'page' or 'database'",
              },
            },
          },
          sort: {
            type: "object",
            description: "Sort order of results",
            properties: {
              direction: {
                type: "string",
                enum: ["ascending", "descending"],
              },
              timestamp: {
                type: "string",
                enum: ["last_edited_time"],
              },
            },
          },
          start_cursor: {
            type: "string",
            description: "Pagination start cursor",
          },
          page_size: {
            type: "number",
            description: "Number of results to return (max 100). ",
          },
          format: formatParameter,
        },
      },
    };
  • Registers the notion_search tool (as schemas.searchTool) in the MCP server's listTools handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      const allTools = [
        schemas.appendBlockChildrenTool,
        schemas.retrieveBlockTool,
        schemas.retrieveBlockChildrenTool,
        schemas.deleteBlockTool,
        schemas.updateBlockTool,
        schemas.retrievePageTool,
        schemas.updatePagePropertiesTool,
        schemas.listAllUsersTool,
        schemas.retrieveUserTool,
        schemas.retrieveBotUserTool,
        schemas.createDatabaseTool,
        schemas.queryDatabaseTool,
        schemas.retrieveDatabaseTool,
        schemas.updateDatabaseTool,
        schemas.createDatabaseItemTool,
        schemas.createCommentTool,
        schemas.retrieveCommentsTool,
        schemas.searchTool,
      ];
      return {
        tools: filterTools(allTools, enabledToolsSet),
      };
    });
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions searching but doesn't cover critical aspects like whether this is a read-only operation, potential rate limits, authentication requirements, or what the output looks like (e.g., pagination details). For a search tool with no annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that efficiently conveys the core functionality without unnecessary words. It's front-loaded with the essential action and resource, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, nested objects) and lack of annotations and output schema, the description is insufficient. It doesn't explain behavioral traits, usage context, or result format, leaving the agent with incomplete information for a tool that interacts with an external API like Notion.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 6 parameters. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't clarify search scope or result format). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('search') and target resources ('pages or databases by title in Notion'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'notion_query_database' or 'notion_retrieve_page', which might also retrieve content from Notion, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'notion_query_database' and 'notion_retrieve_page' available, there's no indication of when searching by title is preferred over other retrieval methods, leaving the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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