Skip to main content
Glama

initialize_notion_database

Creates a Notion database for Kindle book summaries by setting up the required structure under a specified parent page.

Instructions

Creates the Kindle Book Summaries database in Notion under a given parent page. Call this automatically when process_kindle_export returns status='setup_required', using the page ID created by the Notion MCP tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentPageIdYesThe Notion page ID to create the database under

Implementation Reference

  • Main handler function that executes the initialize_notion_database tool logic. Creates a Notion database under a parent page with properties for Name, Author, and Title. Saves the database ID locally and returns the database_id and success message.
    export async function initializeNotionDatabase(
      input: InitializeNotionDatabaseInput
    ): Promise<{ database_id: string; message: string }> {
      const { parentPageId } = InitializeNotionDatabaseInputSchema.parse(input);
    
      const apiKey = process.env.NOTION_API_KEY;
      if (!apiKey) {
        throw new Error("NOTION_API_KEY is not set.");
      }
    
      const notion = new Client({ auth: apiKey });
    
      const database = await notion.databases.create({
        parent: { type: "page_id", page_id: parentPageId },
        title: [{ type: "text", text: { content: DB_TITLE } }],
        properties: {
          Name: { title: {} },
          Author: { rich_text: {} },
          Title: { rich_text: {} },
        },
      });
    
      saveLocalDatabaseId(database.id);
    
      return {
        database_id: database.id,
        message: `Database "${DB_TITLE}" created successfully. Now call process_kindle_export again with the original file to continue.`,
      };
    }
  • Zod input validation schema and TypeScript type definition for the initialize_notion_database tool input. Validates that parentPageId is a non-empty string.
    export const InitializeNotionDatabaseInputSchema = z.object({
      parentPageId: z.string().min(1, "parentPageId must not be empty"),
    });
    
    export type InitializeNotionDatabaseInput = z.infer<
      typeof InitializeNotionDatabaseInputSchema
    >;
  • src/index.ts:38-52 (registration)
    MCP tool registration for initialize_notion_database. Defines the tool name, description, and JSON input schema with parentPageId property that gets exposed to MCP clients.
    {
      name: "initialize_notion_database",
      description:
        "Creates the Kindle Book Summaries database in Notion under a given parent page. Call this automatically when process_kindle_export returns status='setup_required', using the page ID created by the Notion MCP tool.",
      inputSchema: {
        type: "object",
        properties: {
          parentPageId: {
            type: "string",
            description: "The Notion page ID to create the database under",
          },
        },
        required: ["parentPageId"],
      },
    },
  • src/index.ts:134-141 (registration)
    Tool dispatch handler switch case that routes initialize_notion_database calls to the actual implementation function and returns the result as JSON content.
    case "initialize_notion_database": {
      const result = await initializeNotionDatabase(
        args as { parentPageId: string }
      );
      return {
        content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
      };
    }
Behavior3/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. It specifies the database name ('Kindle Book Summaries') which hints at schema intent, but fails to disclose idempotency behavior, required permissions, what happens if the database already exists, or what the tool returns. It meets minimum expectations for a creation tool but lacks safety/reversibility details.

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?

Two sentences with zero waste: first states the action, second states the trigger condition and input source. Information is front-loaded with the core purpose, followed by procedural context. Every word serves the agent's decision-making process.

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?

Given no output schema exists, the description should ideally disclose return values (likely the database ID needed for subsequent push_to_notion calls). The workflow integration is well-explained, but the missing output specification leaves a gap for an agent orchestrating the full pipeline from initialization to content pushing.

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?

With 100% schema coverage, the baseline is 3. The description adds value by specifying the semantic source of the parentPageId ('created by the Notion MCP tool'), guiding the agent on which specific ID to use rather than accepting any arbitrary page ID. This contextualizes the parameter beyond the schema's technical definition.

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

Purpose5/5

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

The description uses a specific verb ('Creates') with a specific resource ('Kindle Book Summaries database') and location context ('under a given parent page'). It clearly distinguishes from siblings like push_to_notion or parse_kindle_clippings by establishing this as the structural initialization step rather than content processing.

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

Usage Guidelines5/5

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

Provides explicit conditional guidance: 'Call this automatically when process_kindle_export returns status='setup_required''. This establishes a clear workflow trigger and prerequisite condition. It also specifies the parameter source ('page ID created by the Notion MCP tool'), guiding the agent on how to obtain valid input.

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/Silcfcr/kindle-mcp'

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