Skip to main content
Glama

fetchAvailableLocales

Retrieve available locales for a specific site and language master to manage multilingual content in Adobe Experience Manager.

Instructions

Get available locales for a site and language master

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
siteYes
languageMasterPathYes

Implementation Reference

  • Core implementation of the fetchAvailableLocales tool logic. Queries the languageMasterPath .json endpoint with depth 2, parses child nodes (skipping jcr/sling prefixed), extracts locales with name, title, language, and wraps in success response.
    async fetchAvailableLocales(site: string, languageMasterPath: string): Promise<LocalesResponse> {
      return safeExecute<LocalesResponse>(async () => {
        const response = await this.httpClient.get(`${languageMasterPath}.json`, { 
          params: { ':depth': '2' } 
        });
        
        const locales: Array<{
          name: string;
          title: string;
          language: string;
        }> = [];
    
        Object.entries(response.data).forEach(([key, value]: [string, any]) => {
          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') as LocalesResponse;
      }, 'fetchAvailableLocales');
    }
  • MCP tool registration entry defining name, description, and input schema (object with required string properties 'site' and 'languageMasterPath').
    {
      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 request handler dispatch case for 'fetchAvailableLocales' that extracts params from args and invokes aemConnector.fetchAvailableLocales.
    case 'fetchAvailableLocales': {
      const { site, languageMasterPath } = args as { site: string; languageMasterPath: string };
      const result = await aemConnector.fetchAvailableLocales(site, languageMasterPath);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • TypeScript interface defining the output structure LocalesResponse for fetchAvailableLocales, extending BaseResponse with site, languageMasterPath, and array of locales (name, title, language).
    export interface LocalesResponse extends BaseResponse {
      data: {
        site: string;
        languageMasterPath: string;
        availableLocales: Array<{
          name: string;
          title: string;
          language: string;
        }>;
      };
    }
  • Delegation wrapper in AEMConnector class that forwards fetchAvailableLocales call to the underlying utilityOps instance.
    async fetchAvailableLocales(site: string, languageMasterPath: string) {
      return this.utilityOps.fetchAvailableLocales(site, languageMasterPath);
    }
Behavior2/5

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

With no annotations, the description carries full burden but lacks behavioral details. It doesn't disclose if this is a read-only operation, what the output format might be (e.g., list of strings), error conditions, or any rate limits. The description is minimal and fails to provide necessary context for safe and effective use.

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, efficient sentence that gets straight to the point without unnecessary words. It's front-loaded with the core purpose, though it could benefit from slightly more detail without losing conciseness.

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 2 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'locales' are, how results are returned, or provide any operational context, making it inadequate for a tool with undocumented inputs and unknown outputs.

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?

Schema description coverage is 0%, so the description must compensate but adds no parameter details. It mentions 'site' and 'language master' contextually but doesn't explain what these parameters represent, their expected formats, or examples. This leaves both parameters undocumented beyond their names.

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

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('available locales'), specifying the context ('for a site and language master'). It distinguishes itself from siblings like 'fetchLanguageMasters' or 'fetchSites' by focusing on locales, but could be more explicit about what 'locales' entails (e.g., language/country codes).

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a valid site or language master), exclusions, or how it differs from similar tools like 'fetchLanguageMasters', leaving the agent to infer usage context.

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