Skip to main content
Glama

fetchSites

Retrieve all available sites in Adobe Experience Manager (AEM) using REST/JSON-RPC APIs for streamlined content and asset management.

Instructions

Get all available sites in AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core implementation of the fetchSites tool. Makes an HTTP GET request to /content.json with depth=2, parses the response to extract site information (name, path, title, template, lastModified), filters out system properties, and returns a structured SitesResponse.
    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'); }
  • Registration of the fetchSites tool in the MCP server tools list, 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, delegating to aemConnector.fetchSites() and formatting the response.
    case 'fetchSites': { const result = await aemConnector.fetchSites(); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Delegation from AEMConnector to UtilityOperations instance for fetchSites execution.
    async fetchSites() { return this.utilityOps.fetchSites();
  • Handler dispatch in MCPRequestHandler switch statement, calling aemConnector.fetchSites().
    case 'fetchSites': return await this.aemConnector.fetchSites();

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