Skip to main content
Glama

notion_retrieve_block_children

Retrieve child blocks from a Notion page or block to access nested content and structure within your workspace.

Instructions

Retrieve the children of a block

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
block_idYesThe ID of the block.It should be a 32-character string (excluding hyphens) formatted as 8-4-4-4-12 with hyphens (-).
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
page_sizeNoNumber of results per page (max 100)
start_cursorNoPagination cursor for next page of results

Implementation Reference

  • Core implementation of retrieveBlockChildren in NotionClientWrapper: constructs API URL with optional pagination params and fetches from Notion API /blocks/{block_id}/children endpoint.
    async retrieveBlockChildren( block_id: string, start_cursor?: string, page_size?: number ): Promise<ListResponse> { const params = new URLSearchParams(); if (start_cursor) params.append("start_cursor", start_cursor); if (page_size) params.append("page_size", page_size.toString()); const response = await fetch( `${this.baseUrl}/blocks/${block_id}/children?${params}`, { method: "GET", headers: this.headers, } ); return response.json(); }
  • MCP tool handler registration: switch case that validates args and delegates to notionClient.retrieveBlockChildren
    case "notion_retrieve_block_children": { const args = request.params .arguments as unknown as args.RetrieveBlockChildrenArgs; if (!args.block_id) { throw new Error("Missing required argument: block_id"); } response = await notionClient.retrieveBlockChildren( args.block_id, args.start_cursor, args.page_size ); break;
  • Tool schema definition: specifies name, description, input schema with properties for block_id (required), optional pagination, and format.
    export const retrieveBlockChildrenTool: Tool = { name: "notion_retrieve_block_children", description: "Retrieve the children of a block", inputSchema: { type: "object", properties: { block_id: { type: "string", description: "The ID of the block." + commonIdDescription, }, start_cursor: { type: "string", description: "Pagination cursor for next page of results", }, page_size: { type: "number", description: "Number of results per page (max 100)", }, format: formatParameter, }, required: ["block_id"], }, };
  • TypeScript interface defining the arguments for the retrieveBlockChildren tool, used for type safety in the handler.
    export interface RetrieveBlockChildrenArgs { block_id: string; start_cursor?: string; page_size?: number; format?: "json" | "markdown"; }
  • Tool inclusion in the allTools array for ListTools MCP request, enabling discovery of the tool.
    schemas.retrieveBlockChildrenTool, schemas.deleteBlockTool,

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

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