Skip to main content
Glama

notion-mcp-server

batchDeleteBlocks.ts946 B
import { notion } from "../services/notion.js"; import { BatchDeleteBlocksParams } from "../types/blocks.js"; import { handleNotionError } from "../utils/error.js"; import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; export const batchDeleteBlocks = async ( params: BatchDeleteBlocksParams ): Promise<CallToolResult> => { try { const results = []; for (const blockId of params.blockIds) { const response = await notion.blocks.delete({ block_id: blockId, }); results.push({ blockId, success: true, response, }); } return { content: [ { type: "text", text: `Successfully deleted ${params.blockIds.length} blocks (moved to trash)`, }, { type: "text", text: JSON.stringify(results, null, 2), }, ], }; } catch (error) { return handleNotionError(error); } };

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