Skip to main content
Glama

aem_list_packages

List installed packages in Adobe Experience Manager to manage content bundles and track deployments.

Instructions

List installed packages in AEM

Input Schema

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

Implementation Reference

  • Handler function that executes the aem_list_packages tool logic: extracts config, calls AEMClient.listPackages, formats the response as MCP content.
    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,
          },
        ],
      };
  • Input schema and metadata for the aem_list_packages tool, provided in the ListToolsRequestSchema response.
    {
      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)
    Registration of the tool handler in the CallToolRequestSchema switch statement, dispatching to AEMTools.listPackages.
    case 'aem_list_packages':
      return await this.aemTools.listPackages(args);
  • Helper method in AEMClient that performs the actual HTTP request to retrieve the list of installed packages from AEM's package manager.
    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'}`);
      }
  • Shared helper method to extract and default AEM configuration from tool arguments.
    private getConfig(args: any): AEMConfig {
      return {
        host: args.host || 'localhost',
        port: args.port || 4506,
        username: args.username || 'admin',
        password: args.password || 'admin',
      };
    }

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