notion_create_database
Create a structured database in Notion with custom properties and rich text formatting to organize information and track data within your workspace.
Instructions
Create a database in Notion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Specify 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 |
| parent | Yes | Parent object of the database | |
| properties | Yes | Property schema of database. The keys are the names of properties as they appear in Notion and the values are property schema objects. | |
| title | No | Title of database as it appears in Notion. An array of rich text objects. |
Implementation Reference
- src/client/index.ts:157-171 (handler)Core implementation of the notion_create_database tool: makes POST request to Notion API /databases endpoint to create a new database.async createDatabase( parent: CreateDatabaseArgs["parent"], properties: Record<string, any>, title?: RichTextItemResponse[] ): Promise<DatabaseResponse> { const body = { parent, title, properties }; const response = await fetch(`${this.baseUrl}/databases`, { method: "POST", headers: this.headers, body: JSON.stringify(body), }); return response.json(); }
- src/server/index.ts:179-187 (handler)Server-side dispatcher for notion_create_database: extracts arguments and delegates to NotionClientWrapper.createDatabase method.case "notion_create_database": { const args = request.params .arguments as unknown as args.CreateDatabaseArgs; response = await notionClient.createDatabase( args.parent, args.properties, args.title ); break;
- src/types/schemas.ts:217-242 (schema)Input schema and metadata definition for the notion_create_database tool.export const createDatabaseTool: Tool = { name: "notion_create_database", description: "Create a database in Notion", inputSchema: { type: "object", properties: { parent: { type: "object", description: "Parent object of the database", }, title: { type: "array", description: "Title of database as it appears in Notion. An array of rich text objects.", items: richTextObjectSchema, }, properties: { type: "object", description: "Property schema of database. The keys are the names of properties as they appear in Notion and the values are property schema objects.", }, format: formatParameter, }, required: ["parent", "properties"], }, };
- src/server/index.ts:302-326 (registration)Registration of notion_create_database tool via inclusion of createDatabaseTool in the listTools response.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), }; });