Skip to main content
Glama
awkoy

notion-mcp-server

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
NameRequiredDescriptionDefault
pageIdYesThe ID of the page to restore

Implementation Reference

  • 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);
      }
    }
  • 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"),
    };
  • 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
    );
  • Dispatch case in the registerPagesOperationTool handler that routes 'restore_page' action to the restorePage implementation.
    case "restore_page":
      return restorePage(params.payload.params);
  • 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),
    }),
Install Server

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

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