Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_case_type_action

Retrieve metadata and available actions for a specific case type action in Pega DX to understand how to interact with case workflows.

Instructions

Get detailed information about a case action, including view metadata and available actions

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
caseTypeIDYesID of the case type for which the case action metadata is being retrieved, for example: Bug
actionIDYesAction ID for case type action (Example: "pyUpdateCaseDetails", "pyApproval"). CRITICAL: Action IDs are CASE-SENSITIVE and have no spaces even if display names do ("Edit details" → "pyUpdateCaseDetails"). Use get_case_types to discover available case types and their supported actions.
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 that implements the get_case_type_action tool logic. Validates inputs, handles sessions, calls the Pega API via pegaClient, and provides standardized error handling.
    async execute(params) {
      const { caseTypeID, actionID } = params;
      let sessionInfo = null;
    
      try {
        // Initialize session configuration if provided
        sessionInfo = this.initializeSessionConfig(params);
    
        // Validate required parameters using base class
        const requiredValidation = this.validateRequiredParams(params, ['caseTypeID', 'actionID']);
        if (requiredValidation) {
          return requiredValidation;
        }
    
        // Execute with standardized error handling
        return await this.executeWithErrorHandling(
          `Case Type Action Metadata: ${caseTypeID} - ${actionID}`,
          async () => await this.pegaClient.getCaseTypeAction(caseTypeID.trim(), actionID.trim()),
          { caseTypeID, actionID, sessionInfo }
        );
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `## Error: Get Case Type Action\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: name 'get_case_type_action', description, inputSchema with required parameters caseTypeID and actionID, and optional sessionCredentials.
    static getDefinition() {
      return {
        name: 'get_case_type_action',
        description: 'Get detailed information about a case action, including view metadata and available actions',
        inputSchema: {
          type: 'object',
          properties: {
            caseTypeID: {
              type: 'string',
              description: 'ID of the case type for which the case action metadata is being retrieved, for example: Bug'
            },
            actionID: {
              type: 'string',
              description: 'Action ID for case type action (Example: "pyUpdateCaseDetails", "pyApproval"). CRITICAL: Action IDs are CASE-SENSITIVE and have no spaces even if display names do ("Edit details" → "pyUpdateCaseDetails"). Use get_case_types to discover available case types and their supported actions.'
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseTypeID', 'actionID']
        }
      };
    }
  • Overridden response formatter specific to case type actions, providing structured output with session info, action details, UI resources summary, available fields/views/components, and data sources.
    formatSuccessResponse(operation, data, options = {}) {
      const { caseTypeID, actionID, 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\n`;
      }
      
      // Basic action information
      response += '### Action Information\n';
      response += `- **Case Type**: ${caseTypeID}\n`;
      response += `- **Action ID**: ${actionID}\n\n`;
      
      // Case info content
      if (data.data && data.data.caseInfo && data.data.caseInfo.content) {
        response += '### Case Content Structure\n';
        const content = data.data.caseInfo.content;
        
        if (Object.keys(content).length > 0) {
          // Display top-level content keys
          const contentKeys = Object.keys(content);
          response += `- **Available Fields**: ${contentKeys.length}\n`;
          response += `- **Main Sections**: ${contentKeys.slice(0, 10).join(', ')}`;
          if (contentKeys.length > 10) {
            response += ` (and ${contentKeys.length - 10} more)`;
          }
          response += '\n\n';
          
          // Show class information if available
          if (content.classID) {
            response += `- **Primary Class**: ${content.classID}\n`;
          }
        } else {
          response += '- No content metadata available\n\n';
        }
      }
    
      // UI Resources - this is the rich metadata section
      if (data.uiResources) {
        response += '### UI Resources\n';
        
        // Root component information
        if (data.uiResources.root) {
          response += '#### Root View Configuration\n';
          const root = data.uiResources.root;
          if (root.config && root.config.name) {
            response += `- **View Name**: ${root.config.name}\n`;
          }
          if (root.type) {
            response += `- **Component Type**: ${root.type}\n`;
          }
          response += '\n';
        }
        
        // Available resources
        if (data.uiResources.resources) {
          const resources = data.uiResources.resources;
          
          // Views information
          if (resources.views) {
            const viewCount = Object.keys(resources.views).length;
            response += `#### Available Views (${viewCount})\n`;
            
            const viewNames = Object.keys(resources.views).slice(0, 8);
            viewNames.forEach(viewName => {
              const viewData = resources.views[viewName];
              if (Array.isArray(viewData) && viewData.length > 0) {
                const view = viewData[0];
                response += `- **${viewName}**: ${view.type || 'View'}`;
                if (view.config && view.config.label) {
                  response += ` ("${view.config.label}")`;
                }
                response += '\n';
              }
            });
            
            if (Object.keys(resources.views).length > 8) {
              response += `- *(and ${Object.keys(resources.views).length - 8} more views)*\n`;
            }
            response += '\n';
          }
          
          // Fields information
          if (resources.fields) {
            const fieldCount = Object.keys(resources.fields).length;
            response += `#### Available Fields (${fieldCount})\n`;
            
            const fieldNames = Object.keys(resources.fields).slice(0, 10);
            fieldNames.forEach(fieldName => {
              const fieldData = resources.fields[fieldName];
              if (Array.isArray(fieldData) && fieldData.length > 0) {
                const field = fieldData[0];
                response += `- **${fieldName}**: ${field.type || 'Unknown'}`;
                if (field.label) {
                  response += ` ("${field.label}")`;
                }
                response += '\n';
              }
            });
            
            if (Object.keys(resources.fields).length > 10) {
              response += `- *(and ${Object.keys(resources.fields).length - 10} more fields)*\n`;
            }
            response += '\n';
          }
          
          // Components information
          if (resources.components) {
            response += `#### UI Components\n`;
            response += `- **Available Components**: ${resources.components.length}\n`;
            response += `- **Component Types**: ${resources.components.join(', ')}\n\n`;
          }
          
          // Data pages information
          if (resources.datapages) {
            const datapageCount = Object.keys(resources.datapages).length;
            response += `#### Data Sources (${datapageCount})\n`;
            
            Object.keys(resources.datapages).slice(0, 5).forEach(dpName => {
              const dp = resources.datapages[dpName];
              response += `- **${dpName}**: ${dp.mode || 'unknown'} mode`;
              if (dp.classID) {
                response += ` (${dp.classID})`;
              }
              response += '\n';
            });
            
            if (Object.keys(resources.datapages).length > 5) {
              response += `- *(and ${Object.keys(resources.datapages).length - 5} more data sources)*\n`;
            }
            response += '\n';
          }
        }
        
        // Action buttons if available
        if (data.uiResources.actionButtons) {
          response += '#### Available Actions\n';
          const buttons = data.uiResources.actionButtons;
          
          if (buttons.main && buttons.main.length > 0) {
            response += '**Primary Actions**:\n';
            buttons.main.forEach(btn => {
              response += `- ${btn.name} (${btn.actionID})\n`;
            });
          }
          
          if (buttons.secondary && buttons.secondary.length > 0) {
            response += '**Secondary Actions**:\n';
            buttons.secondary.forEach(btn => {
              response += `- ${btn.name} (${btn.actionID})\n`;
            });
          }
          response += '\n';
        }
      }
      
      // Context data if available
      if (data.uiResources && data.uiResources.context_data) {
        response += '### Context Information\n';
        response += '- Context data available for form initialization\n';
        if (data.uiResources.context_data.caseInfo) {
          response += '- Case context properly configured\n';
        }
        response += '\n';
      }
      
      return response;
    }
  • Helper method in PegaClient wrapper that delegates to the underlying client library to fetch case type action metadata, invoked by the tool handler.
    async getCaseTypeAction(caseTypeID, actionID) {
      return this.client.getCaseTypeAction(caseTypeID, actionID);
    }
  • Dynamic tool registration loader that scans src/tools/casetypes/, imports get-case-type-action.js, detects the BaseTool subclass by name/execute/getDefinition, instantiates, and registers 'get_case_type_action' in the MCP tool registry.
    export const configurableToolLoader = new ConfigurableToolLoader();
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'gets' information without disclosing behavioral traits like authentication requirements, rate limits, error handling, or response format. It mentions metadata and actions but doesn't clarify if this is a read-only operation or has side effects.

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 a single, efficient sentence that front-loads the core purpose with no wasted words. It directly communicates what the tool does without unnecessary elaboration, making it easy to parse quickly.

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

Completeness3/5

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

Given 3 parameters with 100% schema coverage but no annotations or output schema, the description is adequate for a read operation but incomplete. It should cover more behavioral aspects like authentication needs or response structure, especially since it involves nested objects and no output schema is provided.

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 baseline is 3. The description adds no parameter-specific information beyond what the schema provides (e.g., caseTypeID and actionID usage), but it doesn't compensate for gaps since there are none. It implicitly references parameters through context like 'case action'.

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

Purpose4/5

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

The description clearly states the verb 'Get' and the resource 'detailed information about a case action', including specific content like 'view metadata and available actions'. It distinguishes from siblings like 'get_case_action' by focusing on case type actions rather than general case actions, though this distinction could be more explicit.

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 implies usage for retrieving metadata and actions, and the input schema's parameter descriptions provide guidance on discovering case types via 'get_case_types'. However, it lacks explicit when-not-to-use statements or direct alternatives, such as when to use 'get_case_action' instead.

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