Skip to main content
Glama

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
NameRequiredDescriptionDefault
archivedNoWhether to archive (true) or restore (false) the block
block_idYesID of the block to update
block_typeYesThe type of block (paragraph, heading_1, to_do, etc.)
contentYesThe content for the block based on its type

Implementation Reference

  • 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),
          },
        ],
      };
    }
  • 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"]
      }
    },
Install Server

Other Tools

Related Tools

Latest Blog Posts

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/emmanuelsystems/mcpnotionslack'

If you have feedback or need assistance with the MCP directory API, please join our Discord server