Skip to main content
Glama

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
NameRequiredDescriptionDefault
coverNoPage cover image to update
iconNoPage icon to update
in_trashNoSet to true to archive/delete the page, false to restore it
page_idYesThe ID of the page to update
propertiesNoProperties to update. Keys are property names/IDs, values are property values.

Implementation Reference

  • 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 }; } }
  • 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,

Other Tools

Related Tools

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

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