Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_case_types

Retrieve available case types for creation in a Pega application. Use returned classID as caseTypeID when creating cases.

Instructions

Get list of case types that the user can create in the application. Use returned classID as caseTypeID in create_case. create_case automatically discovers required fields if needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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 primary handler function for the 'get_case_types' MCP tool. It handles session initialization, calls the underlying PegaClient.getCaseTypes() API, applies standardized error handling, and formats responses.
    async execute(params) {
      let sessionInfo = null;
    
      try {
        // Initialize session configuration if provided
        sessionInfo = this.initializeSessionConfig(params);
    
        // Execute with standardized error handling
        return await this.executeWithErrorHandling(
          'Available Case Types',
          async () => await this.pegaClient.getCaseTypes(),
          { sessionInfo }
        );
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `## Error: Get Case Types\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*`
            }
          ]
        };
      }
    }
  • Defines the MCP tool schema for 'get_case_types', including the tool name, description, and input schema (optional session credentials). This is used for tool discovery and validation in the MCP protocol.
    static getDefinition() {
      return {
        name: 'get_case_types',
        description: 'Get list of case types that the user can create in the application. Use returned classID as caseTypeID in create_case. create_case automatically discovers required fields if needed.',
        inputSchema: {
          type: 'object',
          properties: {
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: []
        }
      };
    }
  • Custom helper method to format successful responses into detailed Markdown output, including session info, case type lists with IDs/names/links, constellation/legacy summaries, quick references, and create_case usage examples.
    formatSuccessResponse(operation, data, options = {}) {
      const { sessionInfo } = options;
    
      let response = `## ${operation}\n\n`;
      response += `*Operation completed at: ${new Date().toISOString()}*\n\n`;
    
      // Session Information (if applicable)
      if (sessionInfo) {
        response += `### Session Information\n`;
        response += `- **Session ID**: ${sessionInfo.sessionId}\n`;
        response += `- **Authentication Mode**: ${sessionInfo.authMode.toUpperCase()}\n`;
        response += `- **Configuration Source**: ${sessionInfo.configSource}\n`;
        response += '\n';
      }
      
      // Display application compatibility info
      if (data.applicationIsConstellationCompatible !== undefined) {
        response += `**Application Type**: ${data.applicationIsConstellationCompatible ? 'Constellation Compatible' : 'Legacy (Pre-8.5)'}\n\n`;
      }
    
      if (data.caseTypes && data.caseTypes.length > 0) {
        response += `### Case Types Available for Creation (${data.caseTypes.length})\n\n`;
        
        data.caseTypes.forEach((caseType, index) => {
          response += `#### ${index + 1}. ${caseType.name || 'Unnamed Case Type'}\n`;
          response += `- **ID**: ${caseType.ID}\n`;
          response += `- **Display Name**: ${caseType.name}\n`;
          
          // Display creation link info
          if (caseType.links && caseType.links.create) {
            const createLink = caseType.links.create;
            response += `- **Creation Method**: ${createLink.type || 'POST'} ${createLink.href || '/cases'}\n`;
            response += `- **Creation Title**: ${createLink.title || 'Create Case'}\n`;
            
            if (createLink.request_body && createLink.request_body.caseTypeID) {
              response += `- **Required Case Type ID**: ${createLink.request_body.caseTypeID}\n`;
            }
          }
          
          // Display starting processes for legacy case types
          if (caseType.startingProcesses && caseType.startingProcesses.length > 0) {
            response += `- **Starting Processes** (${caseType.startingProcesses.length}):\n`;
            caseType.startingProcesses.forEach((process, procIndex) => {
              response += `  ${procIndex + 1}. **${process.name}** (ID: ${process.ID})\n`;
              if (process.requiresFieldsToCreate !== undefined) {
                response += `     - Requires Fields: ${process.requiresFieldsToCreate ? 'Yes' : 'No'}\n`;
              }
            });
          }
          
          response += '\n';
        });
        
        // Summary section
        response += '### Summary\n';
        const constellationTypes = data.caseTypes.filter(ct => !ct.startingProcesses || ct.startingProcesses.length === 0);
        const legacyTypes = data.caseTypes.filter(ct => ct.startingProcesses && ct.startingProcesses.length > 0);
        
        response += `- **Total Case Types**: ${data.caseTypes.length}\n`;
        if (constellationTypes.length > 0) {
          response += `- **Constellation Case Types**: ${constellationTypes.length}\n`;
        }
        if (legacyTypes.length > 0) {
          response += `- **Legacy Case Types**: ${legacyTypes.length}\n`;
        }
        
        // Quick reference for case creation
        response += '\n### Quick Reference for Case Creation\n';
        response += 'Use these case type IDs when creating new cases:\n';
        data.caseTypes.forEach((caseType, index) => {
          response += `${index + 1}. **${caseType.name}**: \`${caseType.ID}\`\n`;
        });
    
        // Usage example section
        response += '\n### Using Case Types\n\n';
        response += 'To create a case of one of these types:\n';
        response += '1. Note the **classID** (Example: "UPlus-SAPlus-Work-Lead-Biz")\n';
        response += '2. Use `create_case` with that classID as the caseTypeID parameter\n';
        response += '3. create_case will automatically discover required fields if needed\n\n';
    
        if (data.caseTypes && data.caseTypes.length > 0) {
          const firstType = data.caseTypes[0];
          response += `**Example**: To create a "${firstType.name}" case:\n`;
          response += '```json\n';
          response += '{\n';
          response += '  "caseTypeID": "' + firstType.ID + '",\n';
          response += '  "content": {}\n';
          response += '}\n```\n';
        }
    
      } else {
        response += '### No Case Types Available\n';
        response += 'No case types are currently available for creation in this application.\n';
        response += 'This may be due to:\n';
        response += '- No case types configured in the application\n';
        response += '- Current user lacks permissions to create cases\n';
        response += '- All case types have `canCreate` set to false in the application definition\n';
      }
      
      return response;
    }
  • Underlying API implementation in V1 client that makes the actual HTTP GET request to /prweb/api/v1/casetypes to retrieve available case types. Called by the tool handler via PegaClient proxy.
    async getCaseTypes() {
      const url = `${this.getApiBaseUrl()}/casetypes`;
    
      return await this.makeRequest(url, {
        method: 'GET',
        headers: {
          'x-origin-channel': 'Web'
        }
      });
    }
Behavior3/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 describes the tool's purpose and usage context but lacks details on authentication requirements, rate limits, error handling, or response format. The mention of 'create_case automatically discovers required fields if needed' adds some behavioral context, but more operational details would be helpful.

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 two sentences that are front-loaded with the core purpose, followed by practical usage guidance. Every word earns its place, with no redundancy or unnecessary elaboration, making it highly efficient and well-structured.

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 tool's moderate complexity (retrieving a list with authentication options), no annotations, and no output schema, the description does a good job covering purpose and usage. However, it lacks details on response format, pagination, or error scenarios, which would be valuable for a tool that feeds into 'create_case'.

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?

The description doesn't explicitly mention parameters, but with 100% schema description coverage for the single optional parameter 'sessionCredentials', the schema fully documents authentication details. The description's focus on the tool's purpose and usage with 'create_case' provides adequate semantic context, compensating for the lack of parameter discussion in the description itself.

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: 'Get list of case types that the user can create in the application.' It specifies the verb ('Get'), resource ('case types'), and scope ('that the user can create'), distinguishing it from sibling tools like 'get_case_type_action' or 'get_case_type_bulk_action' which focus on different aspects of case types.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: 'Use returned classID as caseTypeID in create_case.' This explicitly links it to the sibling tool 'create_case', though it doesn't explicitly state when not to use it or mention alternatives like 'get_case_type_action' for other purposes.

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