Skip to main content
Glama
JaxonDigital

Optimizely DXP MCP Server

by JaxonDigital

status

Check deployment status and environment health in Optimizely DXP to monitor progress, identify issues, and verify completion across projects and environments.

Instructions

šŸ“Š Show current deployment status and environment health. REAL-TIME: <1s. Returns deployment states (InProgress, AwaitingVerification, Succeeded, Failed), progress percentage, and error details. Use this to check if deployments need completion or investigation. Optional: environment, project. Returns active deployment info and environment health metrics.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoProject name (uses default if not specified)
environmentNoFilter to specific environment

Implementation Reference

  • Primary handler for the 'status' tool. Fetches recent deployments for the project, handles self-hosted limitations, parses data, and generates a formatted multi-environment status summary with proactive suggestions.
    static async handleStatus(args: StatusArgs): Promise<any> {
        try {
            const { project, environment } = args;
    
            // Get project configuration
            const projectConfig = await this.getProjectConfig(project);
    
            // Check if this is a self-hosted project
            if (projectConfig.isSelfHosted) {
                return ResponseBuilder.invalidParams('Deployment status is not available for self-hosted projects. Self-hosted projects can only download existing backups and blobs.');
            }
    
            // Get deployments with retry
            const deploymentsResult = await this.executeWithRetry(
                () => DeploymentTools.handleListDeployments({
                    projectId: projectConfig.projectId,
                    projectName: projectConfig.name,
                    apiKey: projectConfig.apiKey,
                    apiSecret: projectConfig.apiSecret,
                    limit: 10
                }),
                `status check for ${projectConfig.name}`,
                2 // fewer retries for status checks
            ) as any;
    
            if (!deploymentsResult.isSuccess) {
                // Check if it's a limited access issue
                const errorText = deploymentsResult.content?.[0]?.text || '';
                if (errorText.includes('Environment Access Check') || errorText.includes('403') || errorText.includes('forbidden')) {
                    // This is likely limited environment access - check permissions
                    try {
                        const PermissionChecker = require('./permission-checker');
                        const permissions = await PermissionChecker.checkEnvironmentAccess(projectConfig);
    
                        let response = `ā„¹ļø **Environment Access for ${projectConfig.name}**\n\n`;
    
                        if (permissions.accessible.length > 0) {
                            response += `Your API key has access to: **${permissions.accessible.join(', ')}**\n\n`;
    
                            if (permissions.accessible.length === 1) {
                                const env = permissions.accessible[0];
                                response += `This configuration is `;
                                response += env === 'Integration' ? 'commonly used for development workflows.\n' :
                                          env === 'Preproduction' ? 'commonly used for staging and testing.\n' :
                                          'commonly used for production monitoring.\n';
                            } else if (permissions.accessible.length === 2) {
                                const envs = permissions.accessible.sort();
    
                                // Provide specific context for each dual-environment combination
                                if (envs.includes('Integration') && envs.includes('Production')) {
                                    response += `This configuration provides direct development-to-production access.\n`;
                                    response += `Commonly used for rapid deployment workflows or emergency fixes.\n`;
                                } else if (envs.includes('Integration') && envs.includes('Preproduction')) {
                                    response += `This configuration provides access to development and preproduction environments.\n`;
                                    response += `Commonly used for development teams with staging responsibilities.\n`;
                                } else if (envs.includes('Preproduction') && envs.includes('Production')) {
                                    response += `This configuration provides access to preproduction and production environments.\n`;
                                    response += `Commonly used for deployment teams and production support.\n`;
                                }
                            } else if (permissions.accessible.length === 3) {
                                response += `This configuration provides full access to all environments.\n`;
                            }
    
                            response += '\nThe MCP will automatically use your accessible environments for all operations.';
                            response += '\n\nWhat would you like to do? Try commands like:\n';
                            response += '• "List deployments" - Shows deployments from your accessible environment(s)\n';
                            response += '• "Export database" - Exports from your highest accessible environment\n';
                            response += '• "Check deployment status" - Monitor deployment progress';
                        } else {
                            response += 'āŒ No environment access detected. Please check your API credentials.';
                        }
    
                        return ResponseBuilder.success(response);
                    } catch (permError) {
                        // Fall back to original error if permission check fails
                        return deploymentsResult;
                    }
                }
                return deploymentsResult;
            }
    
            // Parse deployment data safely
            let deployments: Deployment[];
            try {
                deployments = JSON.parse(deploymentsResult.content[0].text);
                if (!Array.isArray(deployments)) {
                    deployments = [];
                }
            } catch (parseError: any) {
                OutputLogger.warn(`Failed to parse deployment data: ${parseError.message}`);
                deployments = [];
            }
    
            // Create intelligent status summary
            const statusSummary = this.formatIntelligentStatus(deployments, environment);
            return ResponseBuilder.successWithVersionCheck(statusSummary, true);
    
        } catch (error: any) {
            return ErrorHandler.handleError(error, 'status', args);
        }
    }
  • Input schema defining optional parameters for the status tool: project name and target environment filter.
    interface StatusArgs {
        project?: string;
        environment?: string;
    }
  • Key helper method that intelligently formats deployment status across environments (Production, Preproduction, Integration) with visual icons, time-ago, progress/ETA estimates, and action suggestions.
    static formatIntelligentStatus(deployments: Deployment[], filterEnvironment?: string): string {
        const environments = ['Production', 'Preproduction', 'Integration'];
        let status = "šŸ“Š **Current Status**\n\n";
    
        // Group deployments by target environment
        const envDeployments: EnvironmentDeployments = {};
        environments.forEach(env => {
            envDeployments[env] = deployments
                .filter(d => d.targetEnvironment === env)
                .sort((a, b) => new Date(b.startTime).getTime() - new Date(a.startTime).getTime())[0] || null;
        });
    
        // Show status for each environment
        environments.forEach(env => {
            if (filterEnvironment && env !== filterEnvironment) return;
    
            const deployment = envDeployments[env];
            const envStatus = this.getEnvironmentStatusIcon(deployment);
            const envDetails = this.getEnvironmentDetails(deployment);
    
            status += `${envStatus} **${env}**: ${envDetails}\n`;
        });
    
        // Add suggestions
        const suggestions = this.generateSuggestions(envDeployments);
        if (suggestions) {
            status += `\nšŸ’” **Suggestions**\n${suggestions}`;
        }
    
        return status;
    }
  • Underlying handler called by status tool to fetch raw deployment data from the DXP API, used via DeploymentTools.handleListDeployments.
    static async handleListDeployments(args: ListDeploymentsArgs): Promise<any> {
        // Check if this is a self-hosted project
        if (args.isSelfHosted || args.connectionString) {
            return ResponseBuilder.invalidParams('Deployment listing is not available for self-hosted projects. Self-hosted projects can only download existing backups and blobs.');
        }
    
        if (!args.apiKey || !args.apiSecret || !args.projectId) {
            return ResponseBuilder.invalidParams('Missing required parameters');
        }
    
        try {
            const result = await this.listDeployments(args);
    
            // DXP-66: Check if result is structured response with data and message
            if (result && typeof result === 'object' && 'data' in result && 'message' in result) {
                return ResponseBuilder.successWithStructuredData(result.data, result.message);
            }
    
            // Fallback for legacy string responses
            return ResponseBuilder.success(result);
        } catch (error: any) {
            console.error('List deployments error:', error);
            return ResponseBuilder.internalError('Failed to list deployments', error.message);
        }
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: real-time performance (<1s), return values (deployment states, progress percentage, error details, active deployment info, environment health metrics), and optional parameters. It doesn't mention rate limits or authentication needs, but covers core functionality adequately.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. Every sentence adds value: real-time performance, return details, usage guidance, and parameter mention. Minor redundancy in mentioning returns could be trimmed, but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description does well to explain return values and behavioral context. It covers the tool's purpose, usage, performance, and outputs adequately for a status-checking tool. Could improve by specifying error handling or data freshness, but largely complete.

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%, so the schema already documents both parameters fully. The description mentions the parameters ('Optional: environment, project') but adds no meaningful semantics beyond what the schema provides. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Show current deployment status and environment health') and resources ('deployment states', 'progress percentage', 'error details', 'environment health metrics'). It distinguishes from siblings like 'get_deployment_status' by emphasizing real-time health checking and investigation needs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool ('Use this to check if deployments need completion or investigation') and distinguishes it from alternatives by focusing on real-time status and health metrics rather than historical data or specific deployment details provided by siblings like 'list_deployments' or 'get_deployment_status'.

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

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