update-block
Modify content or archive status of Notion blocks to keep information current and organized.
Instructions
Update a block's content or archive status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| block_id | Yes | ID of the block to update | |
| block_type | Yes | The type of block (paragraph, heading_1, to_do, etc.) | |
| content | Yes | The content for the block based on its type | |
| archived | No | Whether to archive (true) or restore (false) the block |
Implementation Reference
- server.js:567-592 (handler)The handler logic for the 'update-block' tool. It constructs update parameters using the dynamic block_type key for content, optionally sets archived status, calls notion.blocks.update, and returns the JSON response.else if (name === "update-block") { let { block_id, block_type, content, archived } = args; // Remove dashes if present in block_id block_id = block_id.replace(/-/g, ""); const updateParams = { block_id, [block_type]: content, }; if (archived !== undefined) { updateParams.archived = archived; } const response = await notion.blocks.update(updateParams); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- server.js:242-267 (schema)Input schema definition for the 'update-block' tool in the tools/list response.{ name: "update-block", description: "Update a block's content or archive status", inputSchema: { type: "object", properties: { block_id: { type: "string", description: "ID of the block to update" }, block_type: { type: "string", description: "The type of block (paragraph, heading_1, to_do, etc.)" }, content: { type: "object", description: "The content for the block based on its type" }, archived: { type: "boolean", description: "Whether to archive (true) or restore (false) the block" } }, required: ["block_id", "block_type", "content"] } },
- server.js:242-267 (registration)The tool 'update-block' is registered/listed in the tools/list handler response.{ name: "update-block", description: "Update a block's content or archive status", inputSchema: { type: "object", properties: { block_id: { type: "string", description: "ID of the block to update" }, block_type: { type: "string", description: "The type of block (paragraph, heading_1, to_do, etc.)" }, content: { type: "object", description: "The content for the block based on its type" }, archived: { type: "boolean", description: "Whether to archive (true) or restore (false) the block" } }, required: ["block_id", "block_type", "content"] } },