Skip to main content
Glama

aem_install_package

Install content packages into Adobe Experience Manager to deploy code, configurations, and assets to AEM instances.

Instructions

Install a package in AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packagePathYesPath to the package file (.zip)
hostNoAEM host (default: localhost)localhost
portNoAEM port (default: 4502)
usernameNoAEM username (default: admin)admin
passwordNoAEM password (default: admin)admin
forceNoForce installation (default: false)

Implementation Reference

  • The primary handler function for the 'aem_install_package' tool. It processes input arguments, validates the package path, delegates to AEMClient for installation, and formats the response.
      async installPackage(args: any) {
        const config = this.getConfig(args);
        const { packagePath, force = false } = args;
    
        if (!packagePath) {
          throw new Error('Package path is required');
        }
    
        const result = await this.aemClient.installPackage(config, packagePath, force);
        
        return {
          content: [
            {
              type: 'text',
              text: `Package Installation Result:
    Success: ${result.success}
    Message: ${result.message}
    Package: ${packagePath}
    Force: ${force}`,
            },
          ],
        };
      }
  • Core helper function that handles the actual AEM package installation via HTTP POST to the CRX package manager endpoint, including file upload and authentication.
    async installPackage(config: AEMConfig, packagePath: string, force: boolean = false): Promise<any> {
      const baseUrl = this.getBaseUrl(config);
      const authHeader = this.getAuthHeader(config);
    
      const readFile = promisify(fs.readFile);
      const access = promisify(fs.access);
    
      try {
        // Check if file exists
        await access(packagePath, fs.constants.F_OK);
      } catch (error) {
        throw new Error(`Package file not found: ${packagePath}`);
      }
    
      try {
        // Read the file as buffer instead of using createReadStream
        const fileBuffer = await readFile(packagePath);
        
        const formData = new FormData();
        formData.append('file', fileBuffer, {
          filename: packagePath.split(/[/\\]/).pop() || 'package.zip',
          contentType: 'application/zip'
        });
        formData.append('force', force.toString());
        formData.append('install', 'true');
    
        const response = await this.axiosInstance.post(
          `${baseUrl}/crx/packmgr/service.jsp`,
          formData,
          {
            headers: {
              'Authorization': authHeader,
              ...formData.getHeaders(),
            },
          }
        );
    
        if (response.status === 200) {
          return {
            success: true,
            message: 'Package installed successfully',
            response: response.data,
          };
        } else {
          return {
            success: false,
            message: `Installation failed: HTTP ${response.status}`,
            response: response.data,
          };
        }
      } catch (error) {
        throw new Error(`Package installation failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • Input schema and metadata definition for the 'aem_install_package' tool, registered in the ListTools response.
    {
      name: 'aem_install_package',
      description: 'Install a package in AEM',
      inputSchema: {
        type: 'object',
        properties: {
          packagePath: {
            type: 'string',
            description: 'Path to the package file (.zip)'
          },
          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'
          },
          force: {
            type: 'boolean',
            description: 'Force installation (default: false)',
            default: false
          }
        },
        required: ['packagePath']
      }
    },
  • src/index.ts:355-356 (registration)
    Switch case in the CallToolRequest handler that routes execution to the tool's handler function.
    case 'aem_install_package':
      return await this.aemTools.installPackage(args);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Install' which implies a write/mutation operation, but doesn't cover critical aspects like required permissions (beyond default credentials in schema), potential system impacts (e.g., downtime, cache invalidation), error handling, or what 'force' installation entails. This leaves significant gaps for a tool that modifies AEM state.

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 extremely concise at just 4 words ('Install a package in AEM'), making it front-loaded and efficient. Every word contributes directly to the core purpose without any wasted language, though this brevity comes at the cost of completeness in other dimensions.

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?

For a tool with 6 parameters, no annotations, and no output schema that performs a potentially destructive installation operation in AEM, the description is inadequate. It lacks information about what installation entails, success/failure indicators, system requirements, or relationships to sibling tools. The high parameter count and mutation nature demand more comprehensive documentation than provided.

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

Parameters3/5

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

Schema description coverage is 100%, providing clear documentation for all 6 parameters including defaults. The description adds no additional parameter semantics beyond what's in the schema, such as explaining package file format constraints or the implications of the 'force' option. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

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 action ('Install') and target resource ('a package in AEM'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'aem_list_packages' or 'aem_create_page', which would require more specific language about what installation entails versus listing or creating.

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. It doesn't mention prerequisites (e.g., needing an existing package file), exclusions (e.g., not for updating packages), or refer to sibling tools like 'aem_list_packages' for checking installed packages first, leaving usage context 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/pradeep-moolemane/aem-mcp'

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