Skip to main content
Glama

fetchAvailableLocales

Retrieve available locales for a specific site and language master path using Adobe Experience Manager's MCP Server to manage multilingual content efficiently.

Instructions

Get available locales for a site and language master

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageMasterPathYes
siteYes

Implementation Reference

  • Core handler function that executes the tool logic: fetches JSON from languageMasterPath with depth 2, filters out JCR/sling properties, extracts locale details (name, title, language) from child nodes, and returns a structured success response.
    /** * Get available locales for a site and language master */ async fetchAvailableLocales(site, languageMasterPath) { return safeExecute(async () => { const response = await this.httpClient.get(`${languageMasterPath}.json`, { params: { ':depth': '2' } }); const locales = []; Object.entries(response.data).forEach(([key, value]) => { if (key.startsWith('jcr:') || key.startsWith('sling:')) return; if (value && typeof value === 'object') { locales.push({ name: key, title: value['jcr:content']?.['jcr:title'] || key, language: value['jcr:content']?.['jcr:language'] || key, }); } }); return createSuccessResponse({ site, languageMasterPath, availableLocales: locales, }, 'fetchAvailableLocales'); }, 'fetchAvailableLocales'); }
  • Tool schema definition including name, description, and inputSchema specifying required parameters: site (string) and languageMasterPath (string).
    name: 'fetchAvailableLocales', description: 'Get available locales for a site and language master', inputSchema: { type: 'object', properties: { site: { type: 'string' }, languageMasterPath: { type: 'string' }, }, required: ['site', 'languageMasterPath'], }, },
  • MCP server registration: handles CallToolRequest for 'fetchAvailableLocales' by extracting site and languageMasterPath from args, calling the AEM connector method, and returning JSON stringified result.
    case 'fetchAvailableLocales': { const { site, languageMasterPath } = args; const result = await aemConnector.fetchAvailableLocales(site, languageMasterPath); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Delegation handler in AEMConnector that forwards the call to the utilityOps module implementation.
    async fetchAvailableLocales(site, languageMasterPath) { return this.utilityOps.fetchAvailableLocales(site, languageMasterPath);
  • Alternative dispatch/registration in MCPRequestHandler switch case that calls aemConnector.fetchAvailableLocales with extracted params.
    case 'fetchAvailableLocales': return await this.aemConnector.fetchAvailableLocales(params.site, params.languageMasterPath);

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