Skip to main content
Glama

fetchSites

Retrieve all available sites in Adobe Experience Manager to manage content, components, and assets through REST/JSON-RPC APIs.

Instructions

Get all available sites in AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler implementation for fetchSites tool. Queries AEM /content.json endpoint with depth=2, parses top-level sites, extracts name, path, title, template, and lastModified properties, wraps in standardized response.
    async fetchSites(): Promise<SitesResponse> {
      return safeExecute<SitesResponse>(async () => {
        const response = await this.httpClient.get('/content.json', { 
          params: { ':depth': '2' } 
        });
        
        const sites: Array<{
          name: string;
          path: string;
          title: string;
          template?: string;
          lastModified?: string;
        }> = [];
    
        Object.entries(response.data).forEach(([key, value]: [string, any]) => {
          if (key.startsWith('jcr:') || key.startsWith('sling:')) return;
          if (value && typeof value === 'object' && value['jcr:content']) {
            sites.push({
              name: key,
              path: `/content/${key}`,
              title: value['jcr:content']['jcr:title'] || key,
              template: value['jcr:content']['cq:template'],
              lastModified: value['jcr:content']['cq:lastModified'],
            });
          }
        });
    
        return createSuccessResponse({
          sites,
          totalCount: sites.length,
        }, 'fetchSites') as SitesResponse;
      }, 'fetchSites');
    }
  • Type definition for the output response of fetchSites, defining the structure of sites array and totalCount.
    export interface SitesResponse extends BaseResponse {
      data: {
        sites: Array<{
          name: string;
          path: string;
          title: string;
          template?: string;
          lastModified?: string;
        }>;
        totalCount: number;
      };
    }
  • MCP tool schema definition including name, description, and empty input schema (no parameters required).
    {
      name: 'fetchSites',
      description: 'Get all available sites in AEM',
      inputSchema: { type: 'object', properties: {} },
    },
  • MCP server dispatch handler for fetchSites tool call, invoking AEM connector and returning JSON response.
    case 'fetchSites': {
      const result = await aemConnector.fetchSites();
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Alternative handler registration listing fetchSites in available methods with description and no parameters.
    { name: 'fetchSites', description: 'Get all available sites in AEM', parameters: [] },
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 'Get all available sites' but does not specify if this is a read-only operation, what permissions are needed, how results are returned (e.g., pagination, format), or any rate limits. This is inadequate for a tool with zero 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.

Conciseness5/5

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

The description is a single, efficient sentence with no wasted words. It is front-loaded and directly states the tool's purpose, making it highly concise and well-structured.

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 lack of annotations and output schema, the description is incomplete. It does not explain behavioral traits like safety, response format, or error handling. For a tool with no structured data to rely on, this minimal description fails to provide sufficient context for effective use.

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

Parameters4/5

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

The input schema has no parameters (parameter count: 0), and schema description coverage is 100%, so the description does not need to compensate for missing param info. The description adds value by clarifying the resource ('sites in AEM'), which is not in the schema, but this is minimal since the schema is empty.

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 the resource 'all available sites in AEM', making the purpose understandable. However, it does not explicitly differentiate from sibling tools like 'listPages' or 'listChildren', which might also retrieve site-related data, leaving some ambiguity in scope.

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. With many sibling tools that could involve site data (e.g., 'listPages', 'searchContent'), there is no indication of context, prerequisites, or exclusions, leaving usage unclear.

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