Skip to main content
Glama

notion_update_database

Modify Notion database titles, descriptions, and properties using rich text objects and structured input to enhance workspace organization and data management.

Instructions

Update a database in Notion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_idYesThe ID of the database to update.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-).
descriptionNoAn array of rich text objects that represents the description of the database that is displayed in the Notion UI.
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
propertiesNoThe properties of a database to be changed in the request, in the form of a JSON object.
titleNoAn array of rich text objects that represents the title of the database that is displayed in the Notion UI.

Implementation Reference

  • Handler logic in the CallToolRequest switch statement: casts arguments to UpdateDatabaseArgs and invokes notionClient.updateDatabase method.
    case "notion_update_database": { const args = request.params .arguments as unknown as args.UpdateDatabaseArgs; response = await notionClient.updateDatabase( args.database_id, args.title, args.description, args.properties ); break; }
  • Defines the Tool object including name, description, and inputSchema for the notion_update_database tool.
    export const updateDatabaseTool: Tool = { name: "notion_update_database", description: "Update a database in Notion", inputSchema: { type: "object", properties: { database_id: { type: "string", description: "The ID of the database to update." + commonIdDescription, }, title: { type: "array", description: "An array of rich text objects that represents the title of the database that is displayed in the Notion UI.", items: richTextObjectSchema, }, description: { type: "array", description: "An array of rich text objects that represents the description of the database that is displayed in the Notion UI.", items: richTextObjectSchema, }, properties: { type: "object", description: "The properties of a database to be changed in the request, in the form of a JSON object.", }, format: formatParameter, }, required: ["database_id"], }, };
  • Registers the tool by including schemas.updateDatabaseTool in the allTools array for ListToolsRequest.
    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), }; });
  • Implements the core logic for updating a Notion database via PATCH /databases/{database_id} API endpoint.
    async updateDatabase( database_id: string, title?: RichTextItemResponse[], description?: RichTextItemResponse[], properties?: Record<string, any> ): Promise<DatabaseResponse> { const body: Record<string, any> = {}; if (title) body.title = title; if (description) body.description = description; if (properties) body.properties = properties; const response = await fetch(`${this.baseUrl}/databases/${database_id}`, { method: "PATCH", headers: this.headers, body: JSON.stringify(body), }); return response.json(); }
  • TypeScript interface defining the arguments for the updateDatabase tool handler.
    export interface UpdateDatabaseArgs { database_id: string; title?: RichTextItemResponse[]; description?: RichTextItemResponse[]; properties?: Record<string, any>; format?: "json" | "markdown"; }

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