Skip to main content
Glama

get-block

Retrieve specific Notion blocks by ID to access content, structure, or properties within your workspace.

Instructions

Retrieve a block by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_idYesID of the block to retrieve

Implementation Reference

  • The handler logic for the 'get-block' tool. It extracts the block_id from arguments, removes any dashes from the ID, retrieves the block using the Notion SDK's notion.blocks.retrieve method, and returns the response as a JSON string 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:268-281 (registration)
    Registration of the 'get-block' tool in the response to the tools/list MCP method, providing the tool's name, description, and input schema.
    { 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"] } },
  • Input schema definition for the 'get-block' tool, specifying that a string 'block_id' is required.
    inputSchema: { type: "object", properties: { block_id: { type: "string", description: "ID of the block to retrieve" } }, required: ["block_id"] }

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