Skip to main content
Glama

get_deployment_status

Check the status of a specific deployment in Optimizely DXP by providing the deployment ID, ensuring real-time visibility into deployment progress and outcomes.

Instructions

Get the status of a deployment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNo
apiSecretNo
deploymentIdYes
projectIdNo
projectNameNo

Implementation Reference

  • Primary handler function executing the core logic for the get_deployment_status tool, including waitBeforeCheck handling, monitoring instructions, error handling, and delegation to getDeploymentStatus.
    static async handleGetDeploymentStatus(args: GetDeploymentStatusArgs): Promise<any> { if (!args.apiKey || !args.apiSecret || !args.projectId) { return ResponseBuilder.invalidParams('Missing required parameters'); } const { waitBeforeCheck = 0, monitor = false } = args; // Implement transparent wait-then-check pattern like database exports if (waitBeforeCheck > 0) { const { StructuredLogger } = require('../../structured-logger'); const logger = new StructuredLogger({ context: { tool: 'wait_for_deployment', deployment_id: args.deploymentId } }); const waitMinutes = Math.floor(waitBeforeCheck / 60); const waitSeconds = waitBeforeCheck % 60; const waitDisplay = waitMinutes > 0 ? `${waitMinutes} minute${waitMinutes > 1 ? 's' : ''}${waitSeconds > 0 ? ` ${waitSeconds} second${waitSeconds > 1 ? 's' : ''}` : ''}` : `${waitSeconds} second${waitSeconds > 1 ? 's' : ''}`; logger.info('Waiting before checking deployment status', { wait_seconds: waitBeforeCheck, deployment_id: args.deploymentId }); console.log(`⏳ Waiting ${waitDisplay} before checking deployment status...`); await new Promise(resolve => setTimeout(resolve, waitBeforeCheck * 1000)); logger.info('Wait complete, checking deployment status', { deployment_id: args.deploymentId }); console.log(`✅ Wait complete. Checking deployment status now...`); } try { const result = await this.getDeploymentStatus(args); // Check if result is already a structured response with data and message if (result && typeof result === 'object' && 'data' in result && 'message' in result) { // Add monitoring instructions if monitor mode is enabled if (monitor && result.data && result.data.status) { const monitoringInstructions = this.generateMonitoringInstructions( args.deploymentId!, result.data.status, result.data.percentComplete || 0, args ); result.message = result.message + '\n\n' + monitoringInstructions; } return ResponseBuilder.successWithStructuredData(result.data, result.message); } // Fallback for legacy string responses return ResponseBuilder.success(result); } catch (error: any) { console.error('Get deployment status error:', error); return ResponseBuilder.internalError('Failed to get deployment status', error.message); } }
  • TypeScript interface defining the input schema/arguments for the get_deployment_status tool.
    interface GetDeploymentStatusArgs { apiKey?: string; apiSecret?: string; projectId?: string; projectName?: string; deploymentId?: string; limit?: number; waitBeforeCheck?: number; monitor?: boolean; isNewDeployment?: boolean; apiUrl?: string; }
  • Top-level handler in DeploymentTools module that serves as the likely MCP tool entry point, delegating to the detailed implementation in DeploymentListOperations.
    static async handleGetDeploymentStatus(args: any): Promise<any> { return DeploymentListOperations.handleGetDeploymentStatus(args);
  • Supporting helper function that performs the actual API call to retrieve deployment status from DXP REST API and handles response formatting and errors.
    static async getDeploymentStatus(args: GetDeploymentStatusArgs): Promise<any> { const { apiKey, apiSecret, projectId, deploymentId, limit } = args; // Check if this is a newly created deployment (within last 30 seconds) // If the caller indicates this is a new deployment, add an initial delay if (args.isNewDeployment) { // Wait 3 seconds before first check to allow deployment to register await new Promise(resolve => setTimeout(resolve, 3000)); } // DXP-101: Use REST API instead of PowerShell (3-10x faster, no PowerShell dependency) try { // Get deployment(s) directly from REST API const result: DeploymentResponse | DeploymentResponse[] = await DXPRestClient.getDeployments( projectId!, apiKey!, apiSecret!, deploymentId || null, // Pass deployment ID if checking specific deployment, null for all { apiUrl: args.apiUrl } // Support custom API URLs ); // Format response based on whether we got single or multiple deployments if (Array.isArray(result)) { return DeploymentFormatters.formatMultipleDeployments(result as any, limit); } else if (result) { return DeploymentFormatters.formatSingleDeployment(result as any, args.projectName); } return { data: { deployments: [] }, message: ResponseBuilder.addFooter('No deployment data available') }; } catch (error: any) { // Handle REST API errors const errorDetails = { operation: 'Get Deployment Status', projectId, projectName: args.projectName, deploymentId, apiKey }; // Check if this is an access denied error if (error.statusCode === 401 || error.statusCode === 403) { return ErrorHandler.formatError({ type: 'ACCESS_DENIED', message: 'Access denied to deployment API', statusCode: error.statusCode } as any, errorDetails); } // Generic error handling return ErrorHandler.formatError({ type: 'API_ERROR', message: error.message, statusCode: error.statusCode } as any, errorDetails); } }
  • Tool registration/configuration in the availability matrix, defining hosting types, category, description, and restriction message for get_deployment_status.
    'get_deployment_status': { hostingTypes: ['dxp-paas'], category: 'Deployments', description: 'Get detailed deployment status', restrictedMessage: 'Deployment status is only available for DXP PaaS hosting.'

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/JaxonDigital/optimizely-dxp-mcp'

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