Skip to main content
Glama
JaxonDigital

Optimizely DXP MCP Server

by JaxonDigital

download_list

List and filter Optimizely DXP downloads by status and type to monitor ongoing operations or review history, with pagination for large datasets.

Instructions

📥 List downloads with flexible filtering and pagination. REAL-TIME: <1s. Filter by status (active/completed/failed/all) to monitor ongoing downloads or review history. Filter by type (logs/database/all) to track specific operations. Use pagination (limit, offset) for large download histories. Returns download IDs, status, progress percentage, file info, and start/completion times. Use this to find downloadId for download_status() or download_cancel() calls. All parameters optional.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusNoFilter by status: active (running), completed (successful), failed (errors/cancelled), or allactive
typeNoFilter by download typeall
limitNoMax results for history queries (1-100)
offsetNoPagination offset for history

Implementation Reference

  • The primary handler function for the 'download_list' tool. Validates input arguments, retrieves active and historical downloads from both log and database systems, applies filters by status and type, sorts and paginates results, formats unified download objects, and returns a structured response with a human-readable message.
    static async handleDownloadList(args: DownloadListArgs): Promise<any> {
        try {
            const { status = 'active', type = 'all', limit = 10, offset = 0 } = args;
    
            // Validate parameters
            const validStatuses = ['active', 'completed', 'failed', 'all'];
            if (!validStatuses.includes(status)) {
                return ResponseBuilder.invalidParams(`Invalid status: ${status}. Must be one of: ${validStatuses.join(', ')}`);
            }
    
            const validTypes = ['logs', 'database', 'all'];
            if (!validTypes.includes(type)) {
                return ResponseBuilder.invalidParams(`Invalid type: ${type}. Must be one of: ${validTypes.join(', ')}`);
            }
    
            if (limit < 0 || limit > 100) {
                return ResponseBuilder.invalidParams(`Invalid limit: ${limit}. Must be between 0 and 100`);
            }
    
            if (offset < 0) {
                return ResponseBuilder.invalidParams(`Invalid offset: ${offset}. Must be >= 0`);
            }
    
            // Get downloads from both systems
            // DXP-178 FIX: Need .default for ES module default export
            const DatabaseSimpleTools = require('./database-simple-tools').default;
    
            // Get log downloads
            const logDownloads = status === 'active'
                ? downloadManager.getActiveDownloads()
                : downloadManager.getHistory(1000); // Get all history for filtering
    
            // Get database downloads
            // DXP-177: Add null check to prevent "Cannot read properties of undefined (reading 'entries')" error
            const dbDownloadsArray = DatabaseSimpleTools.backgroundDownloads
                ? Array.from(DatabaseSimpleTools.backgroundDownloads.entries() as IterableIterator<[string, any]>)
                    .map(([downloadId, download]) => ({ ...download, downloadId }))
                : [];
    
            // Apply status filter
            const filteredLogDownloads = this._filterByStatus(logDownloads, status);
            const filteredDbDownloads = this._filterByStatus(dbDownloadsArray, status);
    
            // Apply type filter
            let allDownloads: UnifiedDownload[] = [];
            if (type === 'all' || type === 'logs') {
                allDownloads.push(...filteredLogDownloads.map(d => this._formatLogDownload(d)));
            }
            if (type === 'all' || type === 'database') {
                allDownloads.push(...filteredDbDownloads.map(d => this._formatDatabaseDownload(d)));
            }
    
            // Sort by startTime (most recent first)
            allDownloads.sort((a, b) => b.startTime - a.startTime);
    
            // Apply pagination (only for non-active status)
            let paginatedDownloads = allDownloads;
            let hasMore = false;
            if (status !== 'active' && limit > 0) {
                paginatedDownloads = allDownloads.slice(offset, offset + limit);
                hasMore = allDownloads.length > offset + limit;
            }
    
            // Build message
            const message = this._buildDownloadListMessage(paginatedDownloads, status, type, hasMore, offset, limit);
    
            // Build structured data
            const structuredData = {
                downloads: paginatedDownloads,
                totalCount: paginatedDownloads.length,
                hasMore: hasMore
            };
    
            return ResponseBuilder.successWithStructuredData(structuredData, message);
    
        } catch (error: any) {
            OutputLogger.error(`Download list error: ${error}`);
            return ResponseBuilder.internalError('Failed to list downloads', error.message);
        }
    }
  • TypeScript interface defining the input arguments for the download_list tool, including optional parameters for filtering by status, type, pagination limit, and offset.
    interface DownloadListArgs {
        status?: 'active' | 'completed' | 'failed' | 'all';
        type?: 'logs' | 'database' | 'all';
        limit?: number;
        offset?: number;
    }
  • Supporting helper methods that assist the handler in filtering, formatting downloads from different sources (logs and database), and building the response message.
    }
    
    /**
     * Filter downloads by status
     * @private
     */
    static _filterByStatus(downloads: any[], status: string): any[] {
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: it specifies real-time performance ('REAL-TIME: <1s'), describes the return format in detail, mentions pagination for large histories, and notes all parameters are optional. It lacks explicit rate limit or error handling details, but covers most essential aspects.

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 and key features (filtering, pagination, real-time). Every sentence adds value, though it could be slightly more streamlined by avoiding repetition of filter details already in the schema.

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 a good job of covering the tool's behavior, return values, and usage context. It explains what the tool returns and how to use the results with other tools, making it largely complete for a listing tool with optional parameters.

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 all parameters thoroughly. The description adds minimal value beyond the schema by briefly mentioning filtering and pagination use cases, but doesn't provide additional syntax or format details. This meets the baseline for high schema coverage.

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 ('List downloads') and resources ('download IDs, status, progress percentage, file info, and start/completion times'), distinguishing it from siblings like download_status() or download_cancel() which operate on individual downloads rather than listing them.

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 ('to find downloadId for download_status() or download_cancel() calls') and provides context for filtering by status ('to monitor ongoing downloads or review history') and type ('to track specific operations'), offering clear guidance on its application versus alternatives.

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