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
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Implementation Reference
- dist/aem-connector.js:458-516 (handler)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'); }
- dist/mcp-server.js:657-661 (handler)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) }] }; }
- dist/mcp-server.js:178-186 (registration)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'], }, },
- dist/mcp-handler.js:39-40 (schema)Handler dispatch in MCPRequestHandler switch statement for listChildren.case 'listChildren': return await this.aemConnector.listChildren(params.path);
- dist/mcp-handler.js:130-130 (helper)Tool description listed in MCPRequestHandler.getAvailableMethods() for client discovery.{ name: 'listChildren', description: 'Legacy: List child nodes', parameters: ['path'] },