Skip to main content
Glama

getTemplateStructure

Retrieve the detailed structure of an Adobe Experience Manager template by providing its path to analyze components and layout.

Instructions

Get detailed structure of a specific template

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
templatePathYes

Implementation Reference

  • Core implementation of getTemplateStructure: Fetches template .infinity.json from AEM, parses properties, policies, structure, initial content, recursively extracts allowed components, and returns formatted structure.
    async getTemplateStructure(templatePath) {
        return safeExecute(async () => {
            try {
                // Get the full template structure with deeper depth
                const response = await this.httpClient.get(`${templatePath}.infinity.json`);
                const structure = {
                    path: templatePath,
                    properties: response.data['jcr:content'] || {},
                    policies: response.data['jcr:content']?.['policies'] || {},
                    structure: response.data['jcr:content']?.['structure'] || {},
                    initialContent: response.data['jcr:content']?.['initial'] || {},
                    allowedComponents: [],
                    allowedPaths: response.data['jcr:content']?.['allowedPaths'] || []
                };
                // Extract allowed components from policies
                const extractComponents = (node, path = '') => {
                    if (!node || typeof node !== 'object')
                        return;
                    if (node['components']) {
                        const componentKeys = Object.keys(node['components']);
                        structure.allowedComponents.push(...componentKeys);
                    }
                    Object.entries(node).forEach(([key, value]) => {
                        if (typeof value === 'object' && value !== null && !key.startsWith('jcr:')) {
                            extractComponents(value, path ? `${path}/${key}` : key);
                        }
                    });
                };
                extractComponents(structure.policies);
                // Remove duplicates
                structure.allowedComponents = [...new Set(structure.allowedComponents)];
                return createSuccessResponse({
                    templatePath,
                    structure,
                    fullData: response.data
                }, 'getTemplateStructure');
            }
            catch (error) {
                throw handleAEMHttpError(error, 'getTemplateStructure');
            }
        }, 'getTemplateStructure');
    }
  • MCP tool schema definition for getTemplateStructure, specifying input as object with required templatePath string.
        name: 'getTemplateStructure',
        description: 'Get detailed structure of a specific template',
        inputSchema: {
            type: 'object',
            properties: { templatePath: { type: 'string' } },
            required: ['templatePath'],
        },
    },
  • MCP CallToolRequest handler case for getTemplateStructure: extracts templatePath from args, calls AEMConnector, returns JSON stringified result.
    case 'getTemplateStructure': {
        const templatePath = args.templatePath;
        const result = await aemConnector.getTemplateStructure(templatePath);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Delegation method in AEMConnector class that forwards getTemplateStructure call to the TemplateOperations module.
    async getTemplateStructure(templatePath) {
        return this.templateOps.getTemplateStructure(templatePath);
    }
  • Registers the listTools handler that returns the full tools array including getTemplateStructure schema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
        return { tools };
    });
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves information ('Get'), implying a read-only operation, but does not specify aspects like authentication needs, rate limits, error handling, or what 'detailed structure' includes in the response. This is a significant gap 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.

Conciseness4/5

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

The description is a single, clear sentence that is front-loaded and efficient, with no unnecessary words. It effectively communicates the core purpose without redundancy, though it could be more informative by adding context or examples.

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 the complexity of retrieving template structure, the lack of annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It does not explain what the tool returns or how to interpret results, leaving critical gaps for the agent to understand and use the tool effectively.

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

Parameters2/5

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

The input schema has 1 parameter with 0% description coverage, and the tool description does not explain the 'templatePath' parameter. It fails to add meaning beyond the schema, such as what format the path should be in or examples of valid values, which is inadequate given the low schema coverage.

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

Purpose3/5

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

The description states the action ('Get') and resource ('detailed structure of a specific template'), which clarifies the tool's purpose. However, it lacks specificity about what 'detailed structure' entails (e.g., fields, hierarchy, metadata) and does not distinguish it from sibling tools like 'getTemplates' or 'getPageContent', making it somewhat vague.

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. It does not mention prerequisites, context, or exclusions, such as how it differs from 'getTemplates' (which might list templates) or 'getPageContent' (which might retrieve page data). This leaves the agent without clear 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