Skip to main content
Glama

aem_bundle_status

Monitor and verify the status of OSGi bundles in AEM instances by specifying bundle ID, host, port, username, and password. Simplify bundle management and troubleshooting.

Instructions

Check OSGi bundle status

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bundleIdNoSpecific bundle ID or symbolic name (optional)
hostNoAEM host (default: localhost)localhost
passwordNoAEM password (default: admin)admin
portNoAEM port (default: 4502)
usernameNoAEM username (default: admin)admin

Implementation Reference

  • The AEMTools.getBundleStatus method that executes the tool logic: processes input arguments, calls AEMClient to fetch bundle status, formats summary or details, and returns MCP-formatted content response.
    async getBundleStatus(args: any) { const config = this.getConfig(args); const { bundleId } = args; const result = await this.aemClient.getBundleStatus(config, bundleId); let bundleText = `OSGi Bundle Status: ${bundleId ? `Bundle ID: ${bundleId}` : 'All Bundles'} Success: ${result.success} `; if (result.success && result.bundles) { if (bundleId) { // Single bundle bundleText += `Bundle Details:\n${JSON.stringify(result.bundles, null, 2)}`; } else { // All bundles summary const bundles = result.bundles; if (bundles.s && Array.isArray(bundles.s)) { const totalBundles = bundles.s.length; const activeBundles = bundles.s.filter((bundle: any) => bundle.state === 'Active').length; const resolvedBundles = bundles.s.filter((bundle: any) => bundle.state === 'Resolved').length; const installedBundles = bundles.s.filter((bundle: any) => bundle.state === 'Installed').length; bundleText += `Total Bundles: ${totalBundles} Active Bundles: ${activeBundles} Resolved Bundles: ${resolvedBundles} Installed Bundles: ${installedBundles} Bundle Summary: ${bundles.s.slice(0, 10).map((bundle: any) => `- ${bundle.name} (${bundle.symbolicName}): ${bundle.state}` ).join('\n')} ${totalBundles > 10 ? `\n... and ${totalBundles - 10} more bundles` : ''}`; } else { bundleText += `Bundle Data:\n${JSON.stringify(bundles, null, 2)}`; } } } else { bundleText += `Message: ${result.message || 'Failed to get bundle status'}`; } return { content: [ { type: 'text', text: bundleText, }, ], }; }
  • Input schema definition for the 'aem_bundle_status' tool, registered in the ListToolsRequestSchema handler.
    name: 'aem_bundle_status', description: 'Check OSGi bundle status', inputSchema: { type: 'object', properties: { bundleId: { type: 'string', description: 'Specific bundle ID or symbolic name (optional)' }, 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:365-366 (registration)
    Registration of the 'aem_bundle_status' tool handler in the switch statement within the CallToolRequestSchema request handler.
    case 'aem_bundle_status': return await this.aemTools.getBundleStatus(args);
  • AEMClient.getBundleStatus helper method that makes the HTTP GET request to AEM's OSGi bundles endpoint (/system/console/bundles.json or specific bundle) with authentication.
    async getBundleStatus(config: AEMConfig, bundleId?: string): Promise<any> { const baseUrl = this.getBaseUrl(config); const authHeader = this.getAuthHeader(config); try { const url = bundleId ? `${baseUrl}/system/console/bundles/${bundleId}.json` : `${baseUrl}/system/console/bundles.json`; const response = await this.axiosInstance.get(url, { headers: { 'Authorization': authHeader, }, }); if (response.status === 200) { return { success: true, bundles: response.data, }; } else { return { success: false, message: `Failed to get bundle status: HTTP ${response.status}`, }; } } catch (error) { throw new Error(`Failed to get bundle status: ${error instanceof Error ? error.message : 'Unknown error'}`); } }

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