Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NITS: Question about inconsistency between type definition, schema, and documentation #25

Closed
nanahiryu opened this issue Mar 23, 2025 · 1 comment

Comments

@nanahiryu
Copy link

First of all, thank you for developing this excellent Notion MCP Server. The tool has been incredibly useful, and I appreciate the effort that went into creating such a comprehensive implementation of the Notion API.

Question

While working with the codebase, I noticed an inconsistency between the type definition, schema definition, and README documentation for the Notion database creation tool (notion_create_database):

  1. The type definition (CreateDatabaseArgs interface) defines the title parameter as a required parameter:
export interface CreateDatabaseArgs {
  parent: any;
  title: any[]; // required (not optional)
  properties: any;
}
  1. The tool schema definition (createDatabaseTool's inputSchema) does not include "title" in the required array, treating it as an optional parameter:
export const createDatabaseTool = {
  // ...
  inputSchema: {
    // ...
    required: ["parent", "properties"], // "title" is missing
  },
};
  1. The README documentation explicitly lists title as a required input:
7. `notion_create_database`

   - Create a new database.
   - Required inputs:
     - `parent` (object): Parent object of the database.
     - `title` (array): Title of the database as a rich text array.
     - `properties` (object): Property schema of the database.
   - Returns: Information about the created database.

My Question

I'm curious if there's a specific reason why the schema definition doesn't match the type definition and documentation? Are there cases where title should be optional, or could this be an oversight?

Details

The implementation in NotionClientWrapper also treats title as a required parameter:

async createDatabase(
  parent: any,
  title: any[], // required parameter
  properties: any
): Promise<any> {
  const body = { parent, title, properties };
  // ...
}

According to the Notion API documentation, title is indeed a required parameter when creating a database.

Potential Resolution

If this is an oversight, we could align the schema with the type definition and documentation by adding "title" to the required array:

export const createDatabaseTool = {
  // ...
  inputSchema: {
    // ...
    required: ["parent", "title", "properties"], // add "title"
  },
};

This would ensure consistent behavior and validation across the codebase and documentation.

Thank you for considering this question. I'm happy to provide any additional information if needed.

@nanahiryu nanahiryu changed the title NITS: Question about inconsistency between type definition, schema, and documentation for Notion database creation tool NITS: Question about inconsistency between type definition, schema, and documentation Mar 23, 2025
@suekou
Copy link
Owner

suekou commented Apr 6, 2025

@nanahiryu Thank you for reporting the issue in the discussion below. The title parameter was mistakenly marked as required where it should have been optional. I've addressed this in the following PR.

@suekou suekou closed this as completed Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants