fetchLanguageMasters
Retrieve language masters for a specific site using the AEM MCP Server's REST/JSON-RPC API, enabling streamlined content and asset management for multilingual sites.
Instructions
Get language masters for a specific site
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes |
Implementation Reference
- Core handler implementation: Fetches AEM content tree for the site with depth 3, parses direct children as language masters, extracts metadata, wraps in success response.async fetchLanguageMasters(site) { return safeExecute(async () => { const response = await this.httpClient.get(`/content/${site}.json`, { params: { ':depth': '3' } }); const masters = []; Object.entries(response.data).forEach(([key, value]) => { if (key.startsWith('jcr:') || key.startsWith('sling:')) return; if (value && typeof value === 'object' && value['jcr:content']) { masters.push({ name: key, path: `/content/${key}`, title: value['jcr:content']['jcr:title'] || key, language: value['jcr:content']['jcr:language'] || 'en', }); } }); return createSuccessResponse({ site, languageMasters: masters, }, 'fetchLanguageMasters'); }, 'fetchLanguageMasters'); }
- dist/mcp-server.js:73-80 (schema)Input schema definition for the tool, specifying 'site' as required string parameter.name: 'fetchLanguageMasters', description: 'Get language masters for a specific site', inputSchema: { type: 'object', properties: { site: { type: 'string' } }, required: ['site'], }, },
- dist/mcp-server.js:608-612 (registration)Tool dispatch/registration in MCP server switch statement, extracts 'site' from args and calls aemConnector.case 'fetchLanguageMasters': { const site = args.site; const result = await aemConnector.fetchLanguageMasters(site); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- dist/aem-connector-new.js:169-170 (handler)AEM Connector wrapper/delegation to utility operations handler.async fetchLanguageMasters(site) { return this.utilityOps.fetchLanguageMasters(site);
- dist/interfaces/index.d.ts:175-175 (schema)TypeScript interface definition for the method signature and response type.fetchLanguageMasters(site: string): Promise<LanguageMastersResponse>;