Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_list_data_view

Retrieve list data views using advanced querying with pagination, filtering, sorting, aggregation, and distinct values.

Instructions

Retrieve list type data view with advanced querying capabilities. Supports 4 distinct use cases:

  1. Standard Data Retrieval: Get data with pagination, filtering, and sorting Example: { "dataViewID": "D_Employees", "query": { "select": [{"field": "Name"}, {"field": "Age"}], "filter": { "filterConditions": { "F1": { "lhs": {"field": "Department"}, "comparator": "EQ", "rhs": {"value": "IT"} } }, "logic": "F1" } }, "paging": { "pageSize": 100 } }

  2. Aggregated Data: Get aggregated data with optional grouping Example: { "dataViewID": "D_Employees", "query": { "aggregations": { "AvgAge": { "field": "age", "summaryFunction": "AVG" } }, "select": [{"field": "Department"}] }, "paging": { "maxResultsToFetch": 2000 } }

  3. Distinct Values: Get unique values from filtered lists Example: { "dataViewID": "D_Employees", "query": { "select": [{"field": "Department"}], "distinctResultsOnly": true }, "paging": { "maxResultsToFetch": 1000 } }

  4. Non-queryable Data Views: Simple data retrieval without querying Example: { "dataViewID": "D_SimpleData", "dataViewParameters": { "param1": "value1", "param2": "value2" } }

Filter comparators supported: boolean (IS_TRUE, IS_FALSE, IS_NULL, IS_NOT_NULL, EQ, NEQ), string (EQ, NEQ, IN, NOT_IN, IS_NULL, IS_NOT_NULL, STARTS_WITH, NOT_STARTS_WITH, ENDS_WITH, NOT_ENDS_WITH, CONTAINS, NOT_CONTAINS), number/date (EQ, NEQ, IN, NOT_IN, GT, GTE, LT, LTE, ISNULL, ISNOTNULL).

Aggregation functions: COUNT, MAX, MIN, DISTINCT_COUNT. For numbers: SUM, AVG.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataViewIDYesData view ID. Example: "D_CaseList"
dataViewParametersNoParameters for parameterized data views. Key-value pairs. Example: {"CustomerID": "C-123"}
queryNoOptional query object for filtering, sorting, aggregation, and field selection. If not specified, retrieves data as a regular data view.
pagingNoOptional pagination configuration. Can specify either maxResultsToFetch or pageNumber/pageSize combination, but not both.
useExtendedTimeoutNoOptional flag that works only if the data view is sourced by a report definition. When set to true, increases timeout to 45 seconds. Otherwise, timeout is 10 seconds.
sessionCredentialsNoOptional session-specific credentials. If not provided, uses environment variables. Supports two authentication modes: (1) OAuth mode - provide baseUrl, clientId, and clientSecret, or (2) Token mode - provide baseUrl and accessToken.

Implementation Reference

  • The execute() method of GetListDataViewTool - handles the core logic: validates required params (dataViewID), builds request body from optional params (dataViewParameters, query, paging, useExtendedTimeout), and delegates to pegaClient.getListDataView() with standardized error handling.
    async execute(params) {
      const { dataViewID, dataViewParameters, query, paging, useExtendedTimeout } = params;
      let sessionInfo = null;
    
      try {
        sessionInfo = this.initializeSessionConfig(params);
    
        // Validate required parameters
        const requiredValidation = this.validateRequiredParams(params, ['dataViewID']);
        if (requiredValidation) {
          return requiredValidation;
        }
    
        // Build request body from optional parameters
        const requestBody = {};
    
        if (dataViewParameters) {
          requestBody.dataViewParameters = dataViewParameters;
        }
    
        if (query) {
          requestBody.query = query;
        }
    
        if (paging) {
          requestBody.paging = paging;
        }
    
        if (useExtendedTimeout !== undefined) {
          requestBody.useExtendedTimeout = useExtendedTimeout;
        }
    
        // Execute with standardized error handling
        return await this.executeWithErrorHandling(
          `List Data View: ${dataViewID}${query ? ' (with query)' : ''}${paging ? ' (paginated)' : ''}`,
          async () => await this.pegaClient.getListDataView(dataViewID, requestBody),
          { sessionInfo }
        );
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `## Error: List Data View: ${dataViewID}\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*`
          }]
        };
      }
    }
  • Tool definition and input schema for 'get_list_data_view' - defines MCP tool name, description with usage examples, and inputSchema covering dataViewID (required), dataViewParameters, query (select, sortBy, filter, aggregations, distinctResultsOnly), paging (pageNumber, pageSize, maxResultsToFetch), useExtendedTimeout, and sessionCredentials.
      static getDefinition() {
        return {
          name: 'get_list_data_view',
          description: `Retrieve list type data view with advanced querying capabilities. Supports 4 distinct use cases:
    
    1. **Standard Data Retrieval**: Get data with pagination, filtering, and sorting
       Example: { "dataViewID": "D_Employees", "query": { "select": [{"field": "Name"}, {"field": "Age"}], "filter": { "filterConditions": { "F1": { "lhs": {"field": "Department"}, "comparator": "EQ", "rhs": {"value": "IT"} } }, "logic": "F1" } }, "paging": { "pageSize": 100 } }
    
    2. **Aggregated Data**: Get aggregated data with optional grouping
       Example: { "dataViewID": "D_Employees", "query": { "aggregations": { "AvgAge": { "field": "age", "summaryFunction": "AVG" } }, "select": [{"field": "Department"}] }, "paging": { "maxResultsToFetch": 2000 } }
    
    3. **Distinct Values**: Get unique values from filtered lists
       Example: { "dataViewID": "D_Employees", "query": { "select": [{"field": "Department"}], "distinctResultsOnly": true }, "paging": { "maxResultsToFetch": 1000 } }
    
    4. **Non-queryable Data Views**: Simple data retrieval without querying
       Example: { "dataViewID": "D_SimpleData", "dataViewParameters": { "param1": "value1", "param2": "value2" } }
    
    Filter comparators supported: boolean (IS_TRUE, IS_FALSE, IS_NULL, IS_NOT_NULL, EQ, NEQ), string (EQ, NEQ, IN, NOT_IN, IS_NULL, IS_NOT_NULL, STARTS_WITH, NOT_STARTS_WITH, ENDS_WITH, NOT_ENDS_WITH, CONTAINS, NOT_CONTAINS), number/date (EQ, NEQ, IN, NOT_IN, GT, GTE, LT, LTE, ISNULL, ISNOTNULL).
    
    Aggregation functions: COUNT, MAX, MIN, DISTINCT_COUNT. For numbers: SUM, AVG.`,
          inputSchema: {
            type: 'object',
            properties: {
              dataViewID: {
                type: 'string',
                description: 'Data view ID. Example: "D_CaseList"'
              },
              dataViewParameters: {
                type: 'object',
                description: 'Parameters for parameterized data views. Key-value pairs. Example: {"CustomerID": "C-123"}'
              },
              query: {
                type: 'object',
                description: 'Optional query object for filtering, sorting, aggregation, and field selection. If not specified, retrieves data as a regular data view.',
                properties: {
                  select: {
                    type: 'array',
                    description: 'Array of field objects to select. Each object should have a "field" property. Example: [{"field": "Name"}, {"field": "Age"}, {"field": "DOB"}]',
                    items: {
                      type: 'object',
                      properties: {
                        field: {
                          type: 'string',
                          description: 'Field name to select'
                        }
                      },
                      required: ['field']
                    }
                  },
                  sortBy: {
                    type: 'array',
                    description: 'Array of sorting configurations. Each object can specify field name with type (ASC/DESC) or aggregation name with type. Example: [{"field": "Name", "type": "ASC"}, {"aggregation": "AverageAge", "type": "DESC"}]',
                    items: {
                      type: 'object',
                      properties: {
                        field: {
                          type: 'string',
                          description: 'Field name to sort by'
                        },
                        aggregation: {
                          type: 'string',
                          description: 'Aggregation name to sort by'
                        },
                        type: {
                          type: 'string',
                          enum: ['ASC', 'DESC'],
                          description: 'Sort direction - ascending or descending',
                          default: 'ASC'
                        }
                      }
                    }
                  },
                  filter: {
                    type: 'object',
                    description: 'Complex filtering conditions with support for multiple comparators and logical operators.',
                    properties: {
                      filterConditions: {
                        type: 'object',
                        description: 'Object containing filter conditions. Each key (F1, F2, etc.) represents a condition with lhs (left-hand side), comparator, and rhs (right-hand side). Example: {"F1": {"ignoreCase": true, "lhs": {"field": "firstname"}, "comparator": "EQ", "rhs": {"value": "abc"}}, "F2": {"lhs": {"field": "IsRetired"}, "comparator": "IS_TRUE"}}'
                      },
                      logic: {
                        type: 'string',
                        description: 'Logical expression combining filter conditions using AND/OR operators. Supports parentheses. Examples: "F1", "F1 AND F2", "(F1 AND F2) OR (F3 AND F4)". Default is AND.',
                        default: 'AND'
                      }
                    }
                  },
                  aggregations: {
                    type: 'object',
                    description: 'Object containing aggregation definitions. Each key is a unique name for the aggregation, each value contains field and summaryFunction. Example: {"AverageAge": {"field": "age", "summaryFunction": "AVG"}, "EmployeeCount": {"field": "EmployeeID", "summaryFunction": "COUNT"}}'
                  },
                  distinctResultsOnly: {
                    type: 'boolean',
                    description: 'Set to true to return distinct set of results only. Cannot be specified with aggregation. Use with select fields to get unique combinations.',
                    default: false
                  }
                }
              },
              paging: {
                type: 'object',
                description: 'Optional pagination configuration. Can specify either maxResultsToFetch or pageNumber/pageSize combination, but not both.',
                properties: {
                  pageNumber: {
                    type: 'integer',
                    minimum: 1,
                    description: 'Page number to retrieve (1-based). Use with pageSize. Cannot be used with maxResultsToFetch.',
                    default: 1
                  },
                  pageSize: {
                    type: 'integer',
                    minimum: 1,
                    maximum: 5000,
                    description: 'Number of records per page. Maximum value is 5000. Use with pageNumber. Cannot be used with maxResultsToFetch.',
                    default: 100
                  },
                  maxResultsToFetch: {
                    type: 'integer',
                    minimum: 1,
                    maximum: 5000,
                    description: 'Maximum number of results to fetch when data is not paginated. Default and maximum value is 5000. Cannot be used with pageNumber/pageSize.'
                  }
                }
              },
              useExtendedTimeout: {
                type: 'boolean',
                description: 'Optional flag that works only if the data view is sourced by a report definition. When set to true, increases timeout to 45 seconds. Otherwise, timeout is 10 seconds.',
                default: false
              },
              sessionCredentials: getSessionCredentialsSchema()
            },
            required: ['dataViewID']
          }
        };
      }
  • Automatic registration via ConfigurableToolLoader - scans src/tools/dataviews/ directory, imports all .js files, finds tool classes with getDefinition() and execute(), and registers them. No explicit per-tool registration needed.
    async loadToolFile(categoryPath, filename, category) {
      const filePath = resolve(categoryPath, filename);
      const fileUrl = pathToFileURL(filePath).href;
      
      try {
        const module = await import(fileUrl);
        
        // Find the tool class in the module
        const ToolClass = this.findToolClass(module);
        if (!ToolClass) {
          return {
            loaded: false,
            toolName: filename.replace('.js', ''),
            reason: 'No valid tool class found'
          };
        }
        
        // Validate tool class
        const validationResult = this.validateToolClass(ToolClass, category, filename);
        if (!validationResult.valid) {
          return {
            loaded: false,
            toolName: filename.replace('.js', ''),
            reason: validationResult.reason
          };
        }
        
        // Get tool name from definition
        const toolName = ToolClass.getDefinition().name;
        
        // Check if tool should be loaded based on configuration
        if (!toolConfig.isToolEnabled(toolName, category)) {
          return {
            loaded: false,
            toolName: toolName,
            reason: 'disabled in configuration'
          };
        }
        
        // Create and register tool instance
        const toolInstance = new ToolClass();
        
        this.loadedTools.set(toolName, {
          instance: toolInstance,
          class: ToolClass,
          category: category,
          filename: filename
        });
        
        return {
          loaded: true,
          tool: toolInstance,
          toolName: toolName
        };
      } catch (error) {
        throw new Error(`Failed to import ${filename}: ${error.message}`);
      }
    }
  • PegaClient.getListDataView() delegates to the underlying client's getListDataView method - the API call layer that communicates with the Pega instance.
    /**
     * Get list data view
     * @param {string} dataViewID - Data view ID
     * @param {Object} requestBody - Request body
     * @returns {Promise<Object>} Data view results
     */
    async getListDataView(dataViewID, requestBody = {}) {
      return this.client.getListDataView(dataViewID, requestBody);
    }
  • formatDataPagesInfo() helper references 'get_list_data_view' in its instructions, telling users how to fetch options for dropdown/autocomplete fields backed by Data Pages.
    /**
     * Format Data Pages for display with get_list_data_view instructions
     * @param {Array} dataPages - Array of Data Page objects
     * @returns {string} Formatted Data Pages information
     */
    export function formatDataPagesInfo(dataPages) {
      if (!dataPages || dataPages.length === 0) {
        return '';
      }
    
      let info = `### 📊 Data Pages Referenced (${dataPages.length})\n\n`;
      info += `These dropdown/autocomplete fields get their options from Data Pages.\n`;
      info += `Use \`get_list_data_view\` to fetch available options:\n\n`;
    
      dataPages.forEach(dp => {
        info += `**${dp.dataPageID}**\n`;
        info += `- Used by: ${dp.usedByFields.join(', ')}\n`;
    
        if (dp.parameters && dp.parameters.length > 0) {
          const params = dp.parameters.map(p => `"${p.name}": "${p.value || ''}"`).join(', ');
          info += `- Parameters: { ${params} }\n`;
        }
    
        info += `- Fetch options: \`get_list_data_view(dataViewID: "${dp.dataPageID}"`;
        if (dp.parameters && dp.parameters.length > 0) {
          info += `, dataViewParameters: {...}`;
        }
        info += `)\`\n\n`;
      });
    
      return info;
    }
Behavior4/5

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

With no annotations provided, the description carries full burden. It discloses key behavioral traits: supported use cases, filter comparators, aggregation functions, paging limitations, extended timeout conditions, and authentication modes. It also notes constraints like distinctResultsOnly cannot be used with aggregation.

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 well-structured with numbered use cases, tables for comparators, and clear examples. It is somewhat lengthy but every section adds value. It front-loads the purpose and provides progressive detail.

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 the complexity (6 parameters, nested objects, no output schema), the description is comprehensive. It covers all use cases, explains each parameter, and provides examples. However, it does not explicitly describe the return format or structure of the response, which would be helpful.

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 coverage is 100%, so baseline is 3. The description adds significant value by providing extensive examples, enumerating supported comparators and aggregation functions, and explaining parameter interactions (e.g., paging modes, authentication options). This goes beyond the schema descriptions.

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: 'Retrieve list type data view with advanced querying capabilities.' It then enumerates four distinct use cases with concrete examples, making it easy for an agent to understand exactly what the tool does and how it differs from siblings like get_data_view_count or get_data_view_metadata.

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

Usage Guidelines3/5

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

While the description provides detailed examples and use cases, it does not explicitly guide when to use this tool versus alternatives like get_data_view_count for counts or other data retrieval tools. Usage is implied but not contrasted with siblings.

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/marco-looy/pega-dx-mcp'

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