delete_block
Remove or archive a specific block in Notion by providing its block ID using the Notion MCP Server integration.
Instructions
Delete (move to trash) a block in Notion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockId | Yes | The ID of the block to delete/archive |
Implementation Reference
- src/tools/deleteBlock.ts:6-29 (handler)The core handler function for the 'delete_block' tool. It deletes the specified Notion block using the Notion API and returns a success message with the response or handles errors.export const deleteBlock = async ( params: DeleteBlockParams ): Promise<CallToolResult> => { try { const response = await notion.blocks.delete({ block_id: params.blockId, }); return { content: [ { type: "text", text: `Block ${params.blockId} deleted (moved to trash) successfully`, }, { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return handleNotionError(error); } };
- src/tools/blocks.ts:26-27 (registration)Registration/dispatch logic within the 'notion_blocks' tool handler that routes 'delete_block' action to the deleteBlock function.case "delete_block": return deleteBlock(params.payload.params);
- src/schema/blocks.ts:186-188 (schema)Zod schema defining the input parameters for the 'delete_block' tool (blockId). Used in the BLOCKS_OPERATION_SCHEMA.export const DELETE_BLOCK_SCHEMA = { blockId: z.string().describe("The ID of the block to delete/archive"), };
- src/schema/blocks.ts:284-287 (schema)Integration of 'delete_block' action and its schema into the overarching BLOCKS_OPERATION_SCHEMA for the 'notion_blocks' tool..literal("delete_block") .describe("Use this action to delete/archive a block."), params: z.object(DELETE_BLOCK_SCHEMA), }),
- src/tools/index.ts:24-28 (registration)Top-level registration of the 'notion_blocks' MCP tool, which includes the 'delete_block' action among others."notion_blocks", "Perform various block operations (retrieve, update, delete, append children, batch operations)", BLOCKS_OPERATION_SCHEMA, registerBlocksOperationTool );