Skip to main content
Glama

notion_create_database

Create structured databases in Notion by defining parent objects, titles, and property schemas. Organize data with customizable properties for efficient workspace management.

Instructions

Create a database in Notion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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
parentYesParent object of the database
propertiesYesProperty schema of database. The keys are the names of properties as they appear in Notion and the values are property schema objects.
titleNoTitle of database as it appears in Notion. An array of rich text objects.

Implementation Reference

  • Core handler logic: Makes POST request to Notion's /databases endpoint with parent, optional title, and properties.
    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(); }
  • Tool schema defining input parameters: parent (required), properties (required), title (optional), and format.
    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"], }, };
  • Registration of the tool in the list of available tools returned by ListToolsRequestHandler.
    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), };
  • Dispatch handler in CallToolRequest that extracts args and calls the client 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; }

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

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