update_block
Modify or refresh the content of a specific block in Notion using its block ID. Adjust text, formatting, or metadata to keep your workspace up to date.
Instructions
Update a block's content in Notion
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockId | Yes | The ID of the block to update | |
| data | Yes | The block data to update |
Implementation Reference
- src/tools/updateBlock.ts:6-30 (handler)Executes the core logic for the update_block tool by updating the Notion block via API.export const updateBlock = async ( params: UpdateBlockParams ): Promise<CallToolResult> => { try { const response = await notion.blocks.update({ block_id: params.blockId, ...params.data, }); return { content: [ { type: "text", text: `Block ${response.id} updated successfully`, }, { type: "text", text: JSON.stringify(response, null, 2), }, ], }; } catch (error) { return handleNotionError(error); } };
- src/schema/blocks.ts:181-184 (schema)Zod schema for input parameters of update_block: blockId and data.export const UPDATE_BLOCK_SCHEMA = { blockId: z.string().describe("The ID of the block to update"), data: TEXT_BLOCK_REQUEST_SCHEMA.describe("The block data to update"), };
- src/schema/blocks.ts:277-281 (schema)Schema definition for the 'update_block' action within BLOCKS_OPERATION_SCHEMA.action: z .literal("update_block") .describe("Use this action to update a block."), params: z.object(UPDATE_BLOCK_SCHEMA), }),
- src/tools/blocks.ts:24-25 (registration)Dispatches 'update_block' action to the specific handler in the blocks operation tool.case "update_block": return updateBlock(params.payload.params);
- src/tools/index.ts:22-28 (registration)Registers the 'notion_blocks' MCP tool that includes the 'update_block' action.// Register combined blocks operation tool server.tool( "notion_blocks", "Perform various block operations (retrieve, update, delete, append children, batch operations)", BLOCKS_OPERATION_SCHEMA, registerBlocksOperationTool );