Skip to main content
Glama
awkoy

notion-mcp-server

retrieve_block_children

Retrieve child elements of a specific block in Notion using the block ID. Supports pagination for handling large datasets. Integrates with the Notion MCP Server for API interactions.

Instructions

Retrieve the children of a block from Notion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockIdYesThe ID of the block to retrieve children for
page_sizeNoNumber of results to return (1-100)
start_cursorNoCursor for pagination

Implementation Reference

  • The core handler function that executes the retrieve_block_children tool logic by calling the Notion API to list children blocks.
    export const retrieveBlockChildren = async (
      params: RetrieveBlockChildrenParams
    ): Promise<CallToolResult> => {
      try {
        const response = await notion.blocks.children.list({
          block_id: params.blockId,
          start_cursor: params.start_cursor,
          page_size: params.page_size,
        });
    
        return {
          content: [
            {
              type: "text",
              text: `Successfully retrieved ${response.results.length} children of block ${params.blockId}`,
            },
            {
              type: "text",
              text: `Has more: ${response.has_more ? "Yes" : "No"}${
                response.has_more && response.next_cursor
                  ? `, Next cursor: ${response.next_cursor}`
                  : ""
              }`,
            },
            {
              type: "text",
              text: JSON.stringify(response.results, null, 2),
            },
          ],
        };
      } catch (error) {
        return handleNotionError(error);
      }
    };
  • Dispatches the retrieve_block_children action by calling the handler function within the blocks operation tool.
    case "retrieve_block_children":
      return retrieveBlockChildren(params.payload.params);
  • Defines the input schema (parameters) for the retrieve_block_children tool.
    export const RETRIEVE_BLOCK_CHILDREN_SCHEMA = {
      blockId: z.string().describe("The ID of the block to retrieve children for"),
      start_cursor: z.string().optional().describe("Cursor for pagination"),
      page_size: z
        .number()
        .min(1)
        .max(100)
        .optional()
        .describe("Number of results to return (1-100)"),
    };
  • TypeScript type and schema wrapper for retrieve_block_children parameters.
    export const retrieveBlockChildrenSchema = z.object(
      RETRIEVE_BLOCK_CHILDREN_SCHEMA
    );
    export type RetrieveBlockChildrenParams = z.infer<
      typeof retrieveBlockChildrenSchema
    >;
  • Imports the retrieveBlockChildren handler for use in the blocks dispatcher.
    import { retrieveBlockChildren } from "./retrieveBlockChildren.js";
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a retrieval operation but doesn't mention whether it's read-only, safe, or has any side effects. It also omits details about rate limits, authentication needs, or what happens with invalid inputs, leaving significant gaps for a tool with no 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 no wasted words. It's front-loaded with the core purpose and appropriately sized for a straightforward retrieval tool, making it easy to parse quickly.

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?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what 'children' means in Notion's block hierarchy, what the return format looks like, or how pagination works with 'page_size' and 'start_cursor'. This leaves too many unknowns for effective agent use.

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%, so the schema fully documents all three parameters. The description adds no additional meaning beyond what's in the schema, such as explaining the relationship between parameters or providing usage examples. This meets the baseline for high schema coverage.

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

Purpose4/5

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

The description clearly states the action ('Retrieve') and resource ('children of a block from Notion'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'retrieve_block' or explain what 'children' means in the Notion context, which would be needed for a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'retrieve_block' or 'search_pages'. It doesn't mention prerequisites, such as needing a valid block ID, or contextual factors like pagination for large result sets.

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