Skip to main content
Glama
awkoy

notion-mcp-server

batch_append_block_children

Add multiple child blocks to several parent blocks in a single batch operation, simplifying content organization and updates in Notion workflows.

Instructions

Append children to multiple blocks in a single operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationsYesArray of append operations to perform in a single batch

Implementation Reference

  • The main handler function for the batch_append_block_children tool. It loops through the provided operations, appends children to each specified block using the Notion API, collects results, and returns a formatted response or handles errors.
    export const batchAppendBlockChildren = async (
      params: BatchAppendBlockChildrenParams
    ): Promise<CallToolResult> => {
      try {
        const results = [];
    
        for (const operation of params.operations) {
          const response = await notion.blocks.children.append({
            block_id: operation.blockId,
            children: operation.children,
          });
    
          results.push({
            blockId: operation.blockId,
            success: true,
            response,
          });
        }
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully completed ${params.operations.length} append operations`,
            },
            {
              type: "text",
              text: JSON.stringify(results, null, 2),
            },
          ],
        };
      } catch (error) {
        return handleNotionError(error);
      }
    };
  • Zod schema defining the input parameters for batch_append_block_children, consisting of an array of operations each with blockId and children.
    export const BATCH_APPEND_BLOCK_CHILDREN_SCHEMA = {
      operations: z
        .array(
          z.object({
            blockId: z
              .string()
              .describe("The ID of the block to append children to"),
            children: z
              .array(TEXT_BLOCK_REQUEST_SCHEMA)
              .describe("Array of blocks to append as children"),
          })
        )
        .describe("Array of append operations to perform in a single batch"),
    };
  • Registration/dispatch case in the blocks operation tool that calls the batchAppendBlockChildren handler when the action is 'batch_append_block_children'.
    case "batch_append_block_children":
      return batchAppendBlockChildren(params.payload.params);
  • Part of the BLOCKS_OPERATION_SCHEMA discriminated union that defines the structure for the batch_append_block_children action including its literal action name and params schema.
    z.object({
      action: z
        .literal("batch_append_block_children")
        .describe(
          "Use this action to perform batch append operations on blocks."
        ),
      params: z.object(BATCH_APPEND_BLOCK_CHILDREN_SCHEMA),
    }),
  • TypeScript type definition and schema wrapper for BatchAppendBlockChildrenParams inferred from the schema.
    export const batchAppendBlockChildrenSchema = z.object(
      BATCH_APPEND_BLOCK_CHILDREN_SCHEMA
    );
    export type BatchAppendBlockChildrenParams = z.infer<
      typeof batchAppendBlockChildrenSchema
    >;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It states this is a batch operation but doesn't describe whether it's atomic, what happens on partial failures, rate limits, authentication requirements, or mutation effects. The description doesn't contradict annotations (none exist), but fails to provide essential behavioral context for a write operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's core functionality. It's appropriately sized and front-loaded with the essential information, with no wasted words or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex batch write operation with no annotations and no output schema, the description is inadequate. It doesn't address error handling, response format, atomicity guarantees, or performance implications. Given the tool's mutation nature and the rich input schema complexity, more behavioral context is needed for effective agent usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no parameter-specific information beyond what's already in the schema. With 100% schema description coverage for the single 'operations' parameter, the baseline is 3. The description doesn't explain the structure of operations, block types, or provide examples of valid batch configurations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Append children to multiple blocks in a single operation'. It specifies the verb ('append'), resource ('children'), and target ('multiple blocks'), and distinguishes it from the sibling 'append_block_children' by emphasizing batch capability. However, it doesn't explicitly name the sibling for comparison.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when batch operations are preferable over single operations (e.g., 'append_block_children'), nor does it discuss prerequisites, constraints, or performance considerations for batch processing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/awkoy/notion-mcp-server'

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