delete_page
Archive Notion pages to organize completed tasks and finished projects. Archived pages can be restored later for flexible content management.
Instructions
Deletes (archives) a Notion page (database record). In Notion, deletion is actually an archive operation and can be restored later. Use this to organize completed tasks, finished projects, etc.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | The ID of the Notion page to delete (archive). Must be 32 or 36 character UUID format. Example: "123e4567-e89b-12d3-a456-426614174000" |
Input Schema (JSON Schema)
{
"properties": {
"pageId": {
"description": "The ID of the Notion page to delete (archive). Must be 32 or 36 character UUID format. Example: \"123e4567-e89b-12d3-a456-426614174000\"",
"type": "string"
}
},
"required": [
"pageId"
],
"type": "object"
}
Implementation Reference
- MCP tool handler that executes the delete_page tool call by invoking DeletePageUseCase with the provided pageId and returns a success message.private async handleDeletePage(args: any) { await this.dependencies.deletePageUseCase.execute({ pageId: args.pageId, }); return { content: [ { type: 'text' as const, text: 'Page deleted successfully', }, ], }; }
- src/presentation/mcp/MCPServer.ts:203-216 (registration)Registers the 'delete_page' tool with the MCP SDK, defining its name, description, and input schema requiring a pageId.{ name: 'delete_page', description: 'Deletes (archives) a Notion page (database record). In Notion, deletion is actually an archive operation and can be restored later. Use this to organize completed tasks, finished projects, etc.', inputSchema: { type: 'object', properties: { pageId: { type: 'string', description: 'The ID of the Notion page to delete (archive). Must be 32 or 36 character UUID format. Example: "123e4567-e89b-12d3-a456-426614174000"', }, }, required: ['pageId'], }, },
- Input type definition used by DeletePageUseCase for validating the pageId parameter.export interface DeletePageInput { pageId: string; }
- Use case class implementing the core deletion logic: constructs PageId value object and delegates deletion to the page repository.export class DeletePageUseCase { constructor(private readonly pageRepository: IPageRepository) {} async execute(input: DeletePageInput): Promise<void> { const pageId = new PageId(input.pageId); await this.pageRepository.delete(pageId); } }