Skip to main content
Glama
JaxonDigital

Optimizely DXP MCP Server

by JaxonDigital

list_deployments

Retrieve recent Optimizely DXP deployments with filtering options for status, environment, and pagination to manage deployment history efficiently.

Instructions

📋 List recent deployments with filtering and pagination. REAL-TIME: <2s. Returns deployment IDs, status (InProgress, AwaitingVerification, Succeeded, Failed), source/target environments, and timestamps. Set activeOnly=true to show only in-progress/awaiting deployments. Use pagination (limit, offset) for large deployment histories. All parameters optional. Returns deployment history array. Use get_deployment_status() for detailed info on specific deployment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
offsetNo
activeOnlyNoFilter to only active deployments (InProgress, AwaitingVerification, Resetting, Completing). Useful for autonomous agents detecting deployment conflicts.
statusNoFilter by specific deployment status
environmentSlotNoFilter by environment slot
formatNoResponse format: concise (minimal fields for token efficiency) or detailed (all fields)detailed
projectNameNo
projectIdNo
apiKeyNo
apiSecretNo

Implementation Reference

  • Entry point handler for the list_deployments tool. Validates inputs, handles self-hosted restrictions, calls core listDeployments method, and formats response.
    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);
        }
    }
  • TypeScript interface defining input parameters for list_deployments tool.
    interface ListDeploymentsArgs {
        apiKey?: string;
        apiSecret?: string;
        projectId?: string;
        projectName?: string;
        limit?: number;
        offset?: number;
        activeOnly?: boolean;
        status?: string;
        environmentSlot?: string;
        format?: 'concise' | 'detailed';
        isSelfHosted?: boolean;
        connectionString?: string;
        apiUrl?: string;
    }
  • Core implementation: Fetches deployments via DXPRestClient.getDeployments, filters by activeOnly/status/environmentSlot, supports concise/detailed format, handles errors.
    static async listDeployments(args: ListDeploymentsArgs): Promise<any> {
        const { apiKey, apiSecret, projectId, limit, activeOnly = false, status, environmentSlot, format = 'detailed' } = args;
    
        // DXP-101: Use REST API instead of PowerShell (3-10x faster, no PowerShell dependency)
        try {
            // Get deployments directly from REST API
            const deployments: DeploymentResponse | DeploymentResponse[] = await DXPRestClient.getDeployments(
                projectId!,
                apiKey!,
                apiSecret!,
                null, // No specific deployment ID - get all
                { apiUrl: args.apiUrl } // Support custom API URLs for Optimizely internal team
            );
    
            // Ensure we have an array
            let deploymentList: DeploymentResponse[] = Array.isArray(deployments) ? deployments : [deployments];
    
            // DXP-103: Filter to active deployments only if requested
            if (activeOnly) {
                const activeStatuses = ['InProgress', 'AwaitingVerification', 'Resetting', 'Completing'];
                deploymentList = deploymentList.filter(dep =>
                    dep.Status && activeStatuses.includes(dep.Status)
                );
            }
    
            // DXP-76-1: Filter by specific status
            if (status) {
                deploymentList = deploymentList.filter(dep => dep.Status === status);
            }
    
            // DXP-76-1: Filter by environment slot
            if (environmentSlot) {
                deploymentList = deploymentList.filter(dep =>
                    (dep as any).parameters?.environmentSlot === environmentSlot ||
                    (dep as any).TargetEnvironment === environmentSlot
                );
            }
    
            // DXP-76-1: Format response based on format parameter
            if (format === 'concise') {
                // Concise format - return minimal fields for token efficiency
                const conciseList = deploymentList.map(dep => ({
                    id: (dep as any).Id || (dep as any).id,
                    status: dep.Status,
                    environment: (dep as any).parameters?.environmentSlot || (dep as any).TargetEnvironment,
                    startTime: (dep as any).StartTime || (dep as any).Created,
                    percentComplete: dep.PercentComplete || 0
                }));
    
                // Apply limit if specified
                const limited = limit ? conciseList.slice(0, limit) : conciseList;
    
                return {
                    data: { deployments: limited, count: limited.length },
                    message: ResponseBuilder.addFooter(`Found ${limited.length} deployment(s)`)
                };
            }
    
            // Detailed format - use existing formatter
            if (deploymentList.length > 0) {
                return DeploymentFormatters.formatDeploymentList(deploymentList as any, projectId!, limit, args.projectName);
            }
    
            return ResponseBuilder.addFooter(activeOnly ? 'No active deployments found' : 'No deployments found');
    
        } catch (error: any) {
            // Handle REST API errors
            const errorDetails = {
                operation: 'List Deployments',
                projectId,
                projectName: args.projectName,
                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);
        }
    }
  • DeploymentTools wrapper handler that delegates to DeploymentListOperations.handleListDeployments.
    static async handleListDeployments(args: any): Promise<any> {
        return DeploymentListOperations.handleListDeployments(args);
    }
  • Tool metadata/availability definition for list_deployments, including hosting restrictions and description.
    'list_deployments': {
        hostingTypes: ['dxp-paas'],
        category: 'Deployments',
        description: 'List recent deployments',
        restrictedMessage: 'Deployment history is only available for DXP PaaS hosting.'
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 of behavioral disclosure. It does an excellent job: it discloses performance characteristics ('REAL-TIME: <2s'), return format ('Returns deployment IDs, status...'), and practical usage guidance. The only minor gap is it doesn't mention authentication requirements or rate limits, but given the comprehensive behavioral information provided, this deserves a high score.

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 perfectly structured and concise. It starts with the core purpose, then provides key behavioral information, parameter guidance, and alternative tool usage - all in 4 sentences with zero wasted words. Every sentence earns its place by adding value.

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

Completeness5/5

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

For a list/filter tool with 10 parameters and no annotations or output schema, the description provides excellent completeness. It covers purpose, performance, return format, parameter guidance, and alternative tools. Given the complexity of the tool (10 parameters, filtering capabilities), the description gives the agent everything needed to use it correctly without being overwhelming.

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

Parameters4/5

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

Schema description coverage is only 40%, but the description compensates well by explaining key parameters: it clarifies that 'activeOnly=true' shows 'only in-progress/awaiting deployments' and that pagination parameters are 'for large deployment histories.' It also states 'All parameters optional' which is helpful context. While it doesn't cover all 10 parameters, it adds meaningful semantics for the most important ones beyond what the schema provides.

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: 'List recent deployments with filtering and pagination.' It specifies the verb ('List'), resource ('deployments'), and scope ('recent'), and distinguishes from sibling tools by mentioning get_deployment_status() for detailed info on specific deployments. This is specific and distinguishes from alternatives.

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 provides explicit guidance on when to use this tool versus alternatives: 'Use get_deployment_status() for detailed info on specific deployment.' It also explains when to use specific parameters: 'Set activeOnly=true to show only in-progress/awaiting deployments' and 'Use pagination (limit, offset) for large deployment histories.' This gives clear context for usage decisions.

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