Skip to main content
Glama

aem_list_packages

Retrieve and list all installed packages in Adobe Experience Manager (AEM) by specifying host, port, username, and password for efficient package management.

Instructions

List installed packages in AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNoAEM host (default: localhost)localhost
passwordNoAEM password (default: admin)admin
portNoAEM port (default: 4502)
usernameNoAEM username (default: admin)admin

Implementation Reference

  • The primary handler function for the 'aem_list_packages' tool. It processes input arguments, calls the AEMClient to fetch packages, formats the output as text content, and returns the MCP response.
    async listPackages(args: any) { const config = this.getConfig(args); const result = await this.aemClient.listPackages(config); let packagesText = 'Installed Packages:\n'; if (result.success && result.packages) { if (typeof result.packages === 'string') { // Parse HTML response if needed packagesText += result.packages; } else { packagesText += JSON.stringify(result.packages, null, 2); } } else { packagesText += result.message || 'Failed to retrieve packages'; } return { content: [ { type: 'text', text: packagesText, }, ], }; }
  • Core helper function in AEMClient that makes the HTTP request to AEM's package manager endpoint (/crx/packmgr/list.jsp) to retrieve the list of installed packages.
    async listPackages(config: AEMConfig): Promise<any> { const baseUrl = this.getBaseUrl(config); const authHeader = this.getAuthHeader(config); try { const response = await this.axiosInstance.get(`${baseUrl}/crx/packmgr/list.jsp`, { headers: { 'Authorization': authHeader, }, }); if (response.status === 200) { return { success: true, packages: response.data, }; } else { return { success: false, message: `Failed to list packages: HTTP ${response.status}`, }; } } catch (error) { throw new Error(`Failed to list packages: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
  • Input schema definition for the 'aem_list_packages' tool, specifying optional parameters for AEM connection details.
    { name: 'aem_list_packages', description: 'List installed packages in AEM', inputSchema: { type: 'object', properties: { host: { type: 'string', description: 'AEM host (default: localhost)', default: 'localhost' }, port: { type: 'number', description: 'AEM port (default: 4502)', default: 4502 }, username: { type: 'string', description: 'AEM username (default: admin)', default: 'admin' }, password: { type: 'string', description: 'AEM password (default: admin)', default: 'admin' } } } },
  • src/index.ts:357-358 (registration)
    Registers the tool handler in the switch statement for CallToolRequestSchema, dispatching calls to AEMTools.listPackages.
    case 'aem_list_packages': return await this.aemTools.listPackages(args);

Other Tools

Related 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/pradeep-moolemane/aem-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server