get-block
Retrieve specific Notion content blocks using their unique ID with the 'get-block' tool, integrating directly into the Notion MCP Server for AI-driven workspace management and content organization.
Instructions
Retrieve a block by its ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| block_id | Yes | ID of the block to retrieve |
Implementation Reference
- server.js:592-608 (handler)The main handler for the 'get-block' tool. It extracts the block_id from arguments, removes any dashes from the ID, retrieves the block using the Notion API (notion.blocks.retrieve), and returns the JSON-stringified response wrapped in a text content block.else if (name === "get-block") { let { block_id } = args; // Remove dashes if present in block_id block_id = block_id.replace(/-/g, ""); const response = await notion.blocks.retrieve({ block_id }); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- server.js:266-279 (registration)Registration of the 'get-block' tool in the tools/list response, including its name, description, and input schema requiring a 'block_id' string.{ name: "get-block", description: "Retrieve a block by its ID", inputSchema: { type: "object", properties: { block_id: { type: "string", description: "ID of the block to retrieve" } }, required: ["block_id"] } },
- server.js:269-278 (schema)Input schema for the 'get-block' tool, defining the required 'block_id' parameter.inputSchema: { type: "object", properties: { block_id: { type: "string", description: "ID of the block to retrieve" } }, required: ["block_id"] }