Skip to main content
Glama
awkoy

notion-mcp-server

batch_update_blocks

Update multiple Notion blocks simultaneously by specifying an array of operations, streamlining bulk modifications for improved workflow efficiency.

Instructions

Update multiple blocks in a single operation

Input Schema

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

Implementation Reference

  • The core handler function for the "batch_update_blocks" tool. It processes an array of update operations on Notion blocks, calling the Notion API for each, collecting results, and returning a success message with JSON details or handling errors.
    export const batchUpdateBlocks = async (
      params: BatchUpdateBlocksParams
    ): Promise<CallToolResult> => {
      try {
        const results = [];
    
        for (const operation of params.operations) {
          const response = await notion.blocks.update({
            block_id: operation.blockId,
            ...operation.data,
          });
    
          results.push({
            blockId: operation.blockId,
            success: true,
            response,
          });
        }
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully updated ${params.operations.length} blocks`,
            },
            {
              type: "text",
              text: JSON.stringify(results, null, 2),
            },
          ],
        };
      } catch (error) {
        return handleNotionError(error);
      }
    };
  • Zod schema defining the input parameters for batch_update_blocks: an array of objects each containing blockId (string) and data (TEXT_BLOCK_REQUEST_SCHEMA).
    export const BATCH_UPDATE_BLOCKS_SCHEMA = {
      operations: z
        .array(
          z.object({
            blockId: z.string().describe("The ID of the block to update"),
            data: TEXT_BLOCK_REQUEST_SCHEMA.describe("The block data to update"),
          })
        )
        .describe("Array of update operations to perform in a single batch"),
    };
  • Tool registration/dispatch logic within the blocks operation handler. Matches the "batch_update_blocks" action and delegates to the batchUpdateBlocks function.
    case "batch_update_blocks":
      return batchUpdateBlocks(params.payload.params);
  • Part of the BLOCKS_OPERATION_SCHEMA discriminated union defining the "batch_update_blocks" action variant, including description and params schema reference.
    z.object({
      action: z
        .literal("batch_update_blocks")
        .describe(
          "Use this action to perform batch update operations on blocks."
        ),
      params: z.object(BATCH_UPDATE_BLOCKS_SCHEMA),
  • TypeScript type definition and schema wrapper for BatchUpdateBlocksParams, inferred from the schema.
    export const batchUpdateBlocksSchema = z.object(BATCH_UPDATE_BLOCKS_SCHEMA);
    export type BatchUpdateBlocksParams = z.infer<typeof batchUpdateBlocksSchema>;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'update' but doesn't clarify if this is a destructive mutation, what permissions are required, whether changes are atomic or partial, error handling for invalid operations, or rate limits. This is a significant gap for a batch mutation tool with zero annotation coverage.

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 with zero waste—'Update multiple blocks in a single operation'—front-loading the core purpose. It's appropriately sized for a tool with a well-documented schema, though it could benefit from additional context.

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?

Given the complexity of a batch mutation tool with no annotations, no output schema, and rich nested parameters, the description is incomplete. It lacks behavioral context (e.g., atomicity, error handling), usage guidelines, and output expectations, making it inadequate for safe and effective tool invocation.

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?

Schema description coverage is 100%, with detailed descriptions for 'operations' and nested properties like 'blockId' and 'data'. The description adds no parameter semantics beyond the schema, such as explaining the structure of update operations or constraints on batch size. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Update multiple blocks in a single operation' clearly states the verb (update) and resource (blocks), but it's vague about what 'update' entails—whether it modifies content, metadata, or both. It doesn't distinguish this tool from sibling tools like 'update_block' (single-block update) or 'batch_mixed_operations' (which might include updates among other operations).

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., block IDs), compare it to 'update_block' for single updates or 'batch_mixed_operations' for mixed operations, or specify use cases like bulk content edits. This leaves the agent without context for tool selection.

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