notion_update_database
Modify database title, description, or properties in Notion to keep information current and organized.
Instructions
Update a database in Notion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_id | Yes | The ID of the database to update.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-). | |
| title | No | An array of rich text objects that represents the title of the database that is displayed in the Notion UI. | |
| description | No | An array of rich text objects that represents the description of the database that is displayed in the Notion UI. | |
| properties | No | The properties of a database to be changed in the request, in the form of a JSON object. | |
| 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 |
Implementation Reference
- src/client/index.ts:247-265 (handler)The actual implementation of updateDatabase in NotionClientWrapper that makes a PATCH request to Notion API to update database propertiesasync 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(); }
- src/server/index.ts:212-222 (registration)The request routing logic that handles 'notion_update_database' tool calls, extracts arguments, and calls the updateDatabase methodcase "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; }
- src/types/schemas.ts:340-371 (schema)The MCP tool schema definition for notion_update_database that defines the input parameters and their typesexport 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"], }, };
- src/types/args.ts:105-111 (schema)TypeScript interface definition for UpdateDatabaseArgs that types the tool request argumentsexport interface UpdateDatabaseArgs { database_id: string; title?: RichTextItemResponse[]; description?: RichTextItemResponse[]; properties?: Record<string, any>; format?: "json" | "markdown"; }