restore_page
Restores archived Notion pages using the specified page ID. Integrates with Notion MCP Server to enable AI assistants to manage page recovery efficiently.
Instructions
Restore a previously archived Notion page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The ID of the page to restore |
Implementation Reference
- src/tools/updatePage.ts:28-48 (handler)The core handler function for the restore_page action. It calls the Notion API to update the page's archived status to false and returns a success message.export async function restorePage( params: RestorePageParams ): Promise<CallToolResult> { try { const response = await notion.pages.update({ page_id: params.pageId, archived: false, }); return { content: [ { type: "text", text: `Page restored successfully: ${response.id}`, }, ], }; } catch (error) { return handleNotionError(error); } }
- src/schema/page.ts:96-98 (schema)Zod schema defining the input parameters for the restore_page operation (requires pageId).export const RESTORE_PAGE_SCHEMA = { pageId: z.string().describe("The ID of the page to restore"), };
- src/tools/index.ts:16-20 (registration)Registration of the 'notion_pages' tool, which includes the 'restore_page' action as part of its discriminated union schema and handler."notion_pages", "Perform various page operations (create, archive, restore, search, update)", PAGES_OPERATION_SCHEMA, registerPagesOperationTool );
- src/tools/pages.ts:18-19 (registration)Dispatch case in the registerPagesOperationTool handler that routes 'restore_page' action to the restorePage implementation.case "restore_page": return restorePage(params.payload.params);
- src/schema/page.ts:161-166 (schema)Part of the PAGES_OPERATION_SCHEMA discriminated union that defines the structure for the 'restore_page' action including its params schema.z.object({ action: z .literal("restore_page") .describe("Use this action to restore a previously archived page."), params: z.object(RESTORE_PAGE_SCHEMA), }),