Skip to main content
Glama

append-block-children

Add content blocks to existing Notion pages or blocks. Specify a parent block ID and provide the new block objects to insert.

Instructions

Append blocks to a parent block

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_idYesID of the parent block (page or block)
childrenYesList of block objects to append
afterNoOptional ID of an existing block to append after

Implementation Reference

  • The handler function for the 'append-block-children' tool. It processes the input arguments, removes dashes from IDs, constructs parameters, calls the Notion API's notion.blocks.children.append method, and returns the response as JSON text.
    else if (name === "append-block-children") {
      let { block_id, children, after } = args;
      
      // Remove dashes if present in block_id
      block_id = block_id.replace(/-/g, "");
    
      const params = {
        block_id,
        children,
      };
    
      if (after) {
        params.after = after.replace(/-/g, ""); // Ensure after ID is properly formatted
      }
    
      const response = await notion.blocks.children.append(params);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(response, null, 2),
          },
        ],
      };
    }
  • The schema definition for the 'append-block-children' tool, specifying input parameters: block_id (required), children (required array), and optional after.
    {
      name: "append-block-children",
      description: "Append blocks to a parent block",
      inputSchema: {
        type: "object",
        properties: {
          block_id: {
            type: "string",
            description: "ID of the parent block (page or block)"
          },
          children: {
            type: "array",
            description: "List of block objects to append"
          },
          after: {
            type: "string",
            description: "Optional ID of an existing block to append after"
          }
        },
        required: ["block_id", "children"]
      }
    },

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/Sjotie/notionMCP'

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