Skip to main content
Glama

notion_update_block

Modify content in Notion blocks by replacing entire field values based on block type. Use to update text, lists, or other elements within your Notion workspace.

Instructions

Update the content of a block in Notion based on its type. The update replaces the entire value for a given field.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_idYesThe ID of the block to update.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-).
blockYesThe updated content for the block. Must match the block's type schema.
formatNoSpecify the response format. 'json' returns the original data structure, 'markdown' returns a more readable format. Use 'markdown' when the user only needs to read the page and isn't planning to write or modify it. Use 'json' when the user needs to read the page with the intention of writing to or modifying it.markdown

Implementation Reference

  • MCP tool handler for 'notion_update_block': validates input arguments (block_id and block), then delegates to notionClient.updateBlock.
    case "notion_update_block": { const args = request.params .arguments as unknown as args.UpdateBlockArgs; if (!args.block_id || !args.block) { throw new Error("Missing required arguments: block_id and block"); } response = await notionClient.updateBlock( args.block_id, args.block ); break;
  • Tool schema defining name, description, input schema (block_id, block, optional format) for 'notion_update_block'.
    export const updateBlockTool: Tool = { name: "notion_update_block", description: "Update the content of a block in Notion based on its type. The update replaces the entire value for a given field.", inputSchema: { type: "object", properties: { block_id: { type: "string", description: "The ID of the block to update." + commonIdDescription, }, block: { type: "object", description: "The updated content for the block. Must match the block's type schema.", }, format: formatParameter, }, required: ["block_id", "block"], }, };
  • Core implementation in NotionClientWrapper: sends PATCH request to Notion API endpoint /blocks/{block_id} with the block update payload.
    async updateBlock( block_id: string, block: Partial<BlockResponse> ): Promise<BlockResponse> { const response = await fetch(`${this.baseUrl}/blocks/${block_id}`, { method: "PATCH", headers: this.headers, body: JSON.stringify(block), }); return response.json(); }
  • Tool registration: includes updateBlockTool (schemas.updateBlockTool) in the list of available tools returned by ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => { const allTools = [ schemas.appendBlockChildrenTool, schemas.retrieveBlockTool, schemas.retrieveBlockChildrenTool, schemas.deleteBlockTool, schemas.updateBlockTool, schemas.retrievePageTool, schemas.updatePagePropertiesTool, schemas.listAllUsersTool, schemas.retrieveUserTool, schemas.retrieveBotUserTool, schemas.createDatabaseTool, schemas.queryDatabaseTool, schemas.retrieveDatabaseTool, schemas.updateDatabaseTool, schemas.createDatabaseItemTool, schemas.createCommentTool, schemas.retrieveCommentsTool, schemas.searchTool, ]; return { tools: filterTools(allTools, enabledToolsSet), }; });

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

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