Skip to main content
Glama

notion_create_database_item

Add a new page to a Notion database by specifying the database ID and item properties. Choose between JSON or Markdown format for the response based on usage needs.

Instructions

Create a new item (page) in a Notion database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYesThe ID of the database to add the item to.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-).
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
propertiesYesProperties of the new database item. These should match the database schema.

Implementation Reference

  • The core handler function in NotionClientWrapper that executes the tool logic by POSTing to Notion's /pages endpoint to create a new database item.
    async createDatabaseItem( database_id: string, properties: Record<string, any> ): Promise<PageResponse> { const body = { parent: { database_id }, properties, }; const response = await fetch(`${this.baseUrl}/pages`, { method: "POST", headers: this.headers, body: JSON.stringify(body), }); return response.json(); }
  • The Tool schema definition including name, description, and inputSchema for validation.
    export const createDatabaseItemTool: Tool = { name: "notion_create_database_item", description: "Create a new item (page) in a Notion database", inputSchema: { type: "object", properties: { database_id: { type: "string", description: "The ID of the database to add the item to." + commonIdDescription, }, properties: { type: "object", description: "Properties of the new database item. These should match the database schema.", }, format: formatParameter, }, required: ["database_id", "properties"], }, };
  • Dispatch case in the server's CallToolRequest handler that routes the tool call to the client wrapper.
    case "notion_create_database_item": { const args = request.params .arguments as unknown as args.CreateDatabaseItemArgs; response = await notionClient.createDatabaseItem( args.database_id, args.properties ); break; }
  • Registration of the tool schema in the ListToolsRequest handler's allTools array, enabling tool discovery.
    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, ];

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