Skip to main content
Glama

notion_search

Search for pages and databases in Notion by title to quickly find specific content within your workspace.

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

  • Handler case for 'notion_search' tool that parses arguments and delegates to NotionClientWrapper.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;
  • Schema definition for the 'notion_search' tool including input schema, description, and parameters.
    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,
        },
      },
    };
  • Registration of the 'notion_search' tool (as schemas.searchTool) in the list of all available tools returned by ListToolsRequest.
    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,
    ];
  • Core implementation of the search functionality in NotionClientWrapper, making a POST request to Notion's /search API 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();
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

The description is a single sentence with no details on return format, pagination behavior, error handling, or authentication requirements. Without annotations, the description fails to disclose important behavioral traits beyond the basic action.

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 one concise sentence placed at the beginning, immediately conveying the tool's purpose without extraneous detail.

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

Completeness3/5

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

While the schema covers parameters, the overall context is minimal. The description lacks scope (e.g., across which content it searches) and behavior (e.g., pagination, result size limits). It is adequate for basic understanding but leaves gaps for new users.

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

Parameters4/5

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

The input schema describes all parameters with clear definitions, and the 'format' parameter includes usage guidance (when to use markdown vs json). This adds concrete value beyond the schema, aiding correct invocation.

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 tool searches pages or databases by title in Notion. While it distinguishes the action from sibling tools like notion_retrieve_page or notion_query_database, it does not explicitly differentiate the search scope versus database querying.

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?

No guidance is provided on when to use this tool versus alternatives like notion_query_database or notion_retrieve_page. There is no mention of prerequisites, limitations, or when not to use it.

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