notion_update_page
Modify Notion page properties, icons, covers, or archive/restore pages directly. Streamline content updates for improved workspace organization.
Instructions
Updates properties of a Notion page. Can also update icon, cover, or archive/restore pages.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cover | No | Page cover image to update | |
| icon | No | Page icon to update | |
| in_trash | No | Set to true to archive/delete the page, false to restore it | |
| page_id | Yes | The ID of the page to update | |
| properties | No | Properties to update. Keys are property names/IDs, values are property values. |
Implementation Reference
- src/tools/update-page.ts:72-106 (handler)The main handler function for executing the 'notion_update_page' tool. It constructs the update arguments from input, calls NotionClient.updatePage, and returns a formatted response or error message.export async function handleUpdatePageTool(client: NotionClient, args: any) { try { const updateArgs: UpdatePageArgs = { page_id: args.page_id, ...(args.properties && { properties: args.properties }), ...(args.in_trash !== undefined && { archived: args.in_trash }), ...(args.icon && { icon: args.icon }), ...(args.cover && { cover: args.cover }) }; const response = await client.updatePage(updateArgs); return { content: [ { type: 'text', text: `Successfully updated page: ${response.id}\n` + `URL: ${'url' in response ? response.url : 'N/A'}\n` + `Archived: ${'archived' in response ? response.archived : false}\n` + `Last edited: ${'last_edited_time' in response ? response.last_edited_time : 'N/A'}` } ] }; } catch (error: any) { return { content: [ { type: 'text', text: `Error updating page: ${error.message || 'Unknown error'}` } ], isError: true }; } }
- src/tools/update-page.ts:5-70 (schema)The tool definition object including name, description, and detailed input schema for validating arguments to the 'notion_update_page' tool.export const updatePageToolDefinition: Tool = { name: 'notion_update_page', description: 'Updates properties of a Notion page. Can also update icon, cover, or archive/restore pages.', inputSchema: { type: 'object', properties: { page_id: { type: 'string', description: 'The ID of the page to update' }, properties: { type: 'object', description: 'Properties to update. Keys are property names/IDs, values are property values.' }, in_trash: { type: 'boolean', description: 'Set to true to archive/delete the page, false to restore it' }, icon: { type: 'object', properties: { type: { type: 'string', enum: ['emoji', 'external'] }, emoji: { type: 'string', description: 'Emoji character (if type is emoji)' }, external: { type: 'object', properties: { url: { type: 'string', description: 'URL of external image' } } } }, description: 'Page icon to update' }, cover: { type: 'object', properties: { type: { type: 'string', enum: ['external'] }, external: { type: 'object', properties: { url: { type: 'string', description: 'URL of cover image' } }, required: ['url'] } }, required: ['type', 'external'], description: 'Page cover image to update' } }, required: ['page_id'] } };
- src/server.ts:62-63 (registration)Registration of the tool handler in the switch statement within the main NotionServer class's CallToolRequest handler.case 'notion_update_page': return handleUpdatePageTool(this.client, args);
- src/server.ts:125-126 (registration)Registration of the tool handler in the switch statement within the standalone server creator's CallToolRequest handler.case 'notion_update_page': return handleUpdatePageTool(client, args);
- src/server.ts:47-47 (registration)Inclusion of the tool definition in the list of tools returned by ListToolsRequest in the main NotionServer class.updatePageToolDefinition,