Skip to main content
Glama
Olson3R
by Olson3R

get_page_children

Retrieve child pages of a specific Confluence page using its ID, with options for pagination, result limits, and body format output.

Instructions

Get child pages of a specific page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyFormatNoBody format to include: "storage" or "view" (optional)
limitNoMaximum results (default: 25)
pageIdYesParent page ID
startNoStarting index for pagination (default: 0)

Implementation Reference

  • Core handler function that implements the logic to fetch child pages of a given page ID from Confluence API v2, validates space access, and optionally enhances results with body content from v1 API.
    async getPageChildren(pageId: string, limit = 25, start = 0, bodyFormat?: string): Promise<PaginatedResult<ConfluencePage>> {
      const parentPage = await this.getPage(pageId);
      
      if (!parentPage.space || !parentPage.space.key) {
        throw new Error('Unable to determine page space for access validation');
      }
      
      if (!validateSpaceAccess(parentPage.space.key, this.config.allowedSpaces)) {
        throw new Error(`Access denied to space: ${parentPage.space.key}`);
      }
    
      // Get basic children list from v2 API
      const response: AxiosResponse<PaginatedResult<ConfluencePage>> = await this.client.get(`/pages/${pageId}/children`, {
        params: {
          limit,
          start
        }
      });
      
      // If body content is requested, enhance each page with body content from v1 API
      if (bodyFormat && response.data.results.length > 0) {
        const format = bodyFormat === 'view' ? 'body.view' : 'body.storage';
        const auth = Buffer.from(`${this.config.username}:${this.config.apiToken}`).toString('base64');
        
        const enhancedResults = await Promise.all(
          response.data.results.map(async (page) => {
            try {
              const v1Url = `${this.config.baseUrl}/wiki/rest/api/content/${page.id}?expand=${format},version,space`;
              const v1Response = await axios.get(v1Url, {
                headers: {
                  'Authorization': `Basic ${auth}`,
                  'Accept': 'application/json',
                  'Content-Type': 'application/json'
                },
                timeout: 30000
              });
              
              if (v1Response.data.body) {
                page.body = v1Response.data.body;
              }
            } catch (error) {
              if (this.config.debug) {
                console.warn(`Failed to retrieve body content for page ${page.id}:`, error);
              }
            }
            return page;
          })
        );
        
        response.data.results = enhancedResults;
      }
      
      return response.data;
    }
  • MCP server tool call handler for 'get_page_children' that extracts parameters from the request and delegates execution to ConfluenceClient.getPageChildren, returning JSON-formatted results.
    case 'get_page_children': {
      const { pageId, limit = 25, start = 0, bodyFormat } = args as {
        pageId: string;
        limit?: number;
        start?: number;
        bodyFormat?: string;
      };
      
      const children = await confluenceClient.getPageChildren(pageId, limit, start, bodyFormat);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(children, null, 2)
          }
        ]
      };
    }
  • src/index.ts:237-265 (registration)
    Tool registration in the MCP server's listTools handler, defining the name, description, and input schema for the 'get_page_children' tool.
    {
      name: 'get_page_children',
      description: 'Get child pages of a specific page',
      inputSchema: {
        type: 'object',
        properties: {
          pageId: {
            type: 'string',
            description: 'Parent page ID'
          },
          limit: {
            type: 'number',
            description: 'Maximum results (default: 25)',
            default: 25
          },
          start: {
            type: 'number',
            description: 'Starting index for pagination (default: 0)',
            default: 0
          },
          bodyFormat: {
            type: 'string',
            description: 'Body format to include: "storage" or "view" (optional)',
            enum: ['storage', 'view']
          }
        },
        required: ['pageId']
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states 'Get child pages' but doesn't disclose behavioral traits such as whether this is a read-only operation, if it requires authentication, rate limits, or what the return format looks like. The description is minimal and lacks critical context for safe invocation.

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 zero waste. It's front-loaded and appropriately sized for the tool's purpose, 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?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'child pages' entail (e.g., structure, metadata), return values, or error conditions. For a tool with 4 parameters and complex sibling context, this minimal description leaves significant gaps.

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?

The input schema has 100% description coverage, so the schema already documents all parameters well. The description adds no additional meaning beyond implying a parent-child relationship via 'child pages of a specific page', which aligns with the 'pageId' parameter but doesn't enhance understanding beyond the schema.

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 verb 'Get' and resource 'child pages of a specific page', making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_page' or 'get_space_content', which might also retrieve page-related information, so it lacks sibling distinction.

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 'get_page' or 'search_confluence'. It mentions a 'specific page' but doesn't clarify prerequisites or exclusions, leaving the agent to infer usage from context alone.

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/Olson3R/confluence-mcp'

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