update-block
Modify or archive content blocks in Notion using block ID and type. Adjust text, headings, to-dos, or other block types to keep your workspace updated and organized.
Instructions
Update a block's content or archive status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| archived | No | Whether to archive (true) or restore (false) the block | |
| 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 |
Implementation Reference
- server.js:565-590 (handler)Handler for the 'update-block' tool. Destructures arguments, cleans block_id by removing dashes, builds update parameters using computed property [block_type]: content, optionally adds archived flag, calls notion.blocks.update(), and returns the JSON response as text content.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:243-264 (schema)Input schema for 'update-block' tool defining properties block_id, block_type, content (all required), and optional archived boolean.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:241-265 (registration)Registration of the 'update-block' tool in the static tools list returned by the tools/list handler, including name, description, and inputSchema.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"] } },