Skip to main content
Glama

listChildren

Retrieve child nodes from a specified path in Adobe Experience Manager to manage content structure and hierarchy.

Instructions

Legacy: List child nodes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • Core handler function that implements listChildren by fetching AEM node JSON, extracting child nodes (filtering system props), with fallback to QueryBuilder for pages.
    async listChildren(path, depth = 1) {
        return safeExecute(async () => {
            const client = this.createAxiosInstance();
            // First try direct JSON API approach
            try {
                const response = await client.get(`${path}.${depth}.json`);
                const children = [];
                if (response.data && typeof response.data === 'object') {
                    Object.entries(response.data).forEach(([key, value]) => {
                        // Skip JCR system properties and metadata
                        if (key.startsWith('jcr:') || key.startsWith('sling:') || key.startsWith('cq:') ||
                            key.startsWith('rep:') || key.startsWith('oak:') || key === 'jcr:content') {
                            return;
                        }
                        if (value && typeof value === 'object') {
                            const childPath = `${path}/${key}`;
                            children.push({
                                name: key,
                                path: childPath,
                                primaryType: value['jcr:primaryType'] || 'nt:unstructured',
                                title: value['jcr:content']?.['jcr:title'] ||
                                    value['jcr:title'] ||
                                    key,
                                lastModified: value['jcr:content']?.['cq:lastModified'] ||
                                    value['cq:lastModified'],
                                resourceType: value['jcr:content']?.['sling:resourceType'] ||
                                    value['sling:resourceType']
                            });
                        }
                    });
                }
                return children;
            }
            catch (error) {
                // Fallback to QueryBuilder for cq:Page nodes specifically
                if (error.response?.status === 404 || error.response?.status === 403) {
                    const response = await client.get('/bin/querybuilder.json', {
                        params: {
                            path: path,
                            type: 'cq:Page',
                            'p.nodedepth': '1',
                            'p.limit': '1000',
                            'p.hits': 'full'
                        },
                    });
                    const children = (response.data.hits || []).map((hit) => ({
                        name: hit.name || hit.path?.split('/').pop(),
                        path: hit.path,
                        primaryType: hit['jcr:primaryType'] || 'cq:Page',
                        title: hit['jcr:content/jcr:title'] || hit.title || hit.name,
                        lastModified: hit['jcr:content/cq:lastModified'],
                        resourceType: hit['jcr:content/sling:resourceType']
                    }));
                    return children;
                }
                throw error;
            }
        }, 'listChildren');
    }
  • MCP SDK request handler case that processes listChildren tool calls by extracting path argument and invoking the AEM connector.
    case 'listChildren': {
        const path = args.path;
        const children = await aemConnector.listChildren(path);
        return { content: [{ type: 'text', text: JSON.stringify({ children }, null, 2) }] };
    }
  • Registration of the listChildren tool in the MCP server tools array, including input schema requiring 'path' parameter.
    {
        name: 'listChildren',
        description: 'Legacy: List child nodes',
        inputSchema: {
            type: 'object',
            properties: { path: { type: 'string' } },
            required: ['path'],
        },
    },
  • Handler dispatch in MCPRequestHandler switch statement for listChildren.
    case 'listChildren':
        return await this.aemConnector.listChildren(params.path);
  • Tool description listed in MCPRequestHandler.getAvailableMethods() for client discovery.
    { name: 'listChildren', description: 'Legacy: List child nodes', parameters: ['path'] },
Behavior1/5

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

No annotations are provided, so the description must fully disclose behavior. It only states the action without details on permissions, rate limits, output format, or side effects. For a tool with no annotation coverage, this is inadequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded, with no wasted words. However, the 'Legacy' prefix is ambiguous and could be considered unnecessary clutter, slightly reducing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (1 parameter, no annotations, no output schema), the description is incomplete. It fails to explain what 'child nodes' are, the return format, or how it differs from similar tools, making it insufficient for effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain the 'path' parameter's meaning, format, or examples. With one required parameter undocumented in both schema and description, the description adds no value beyond the schema.

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

Purpose2/5

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

The description 'Legacy: List child nodes' restates the tool name 'listChildren' with minimal elaboration, making it tautological. While 'List child nodes' clarifies the verb+resource, it lacks specificity about what 'child nodes' refer to in this context, and the 'Legacy' prefix adds confusion rather than clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/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 'listPages', 'getNodeContent', or other sibling tools. There is no mention of context, prerequisites, or exclusions, leaving the agent with no usage instructions.

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

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/indrasishbanerjee/aem-mcp-server'

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