Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_case

Retrieve comprehensive case details including status, stage, assignments, and available actions to monitor workflow progress and manage case operations.

Instructions

Get comprehensive case information including status, stage, assignments, and available actions. Use AFTER workflow completion or for case overview. Not recommended immediately after create_case (redundant). For working on assignments, use get_assignment instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
caseIDYesCase ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces.
viewTypeNoUI resources to return. "none" returns no UI resources, "page" returns full page UI metadatanone
pageNameNoIf provided, view metadata for specific page name will be returned (only used when viewType is "page")
originChannelNoOrigin of this service. E.g. - Web, Mobile etc.
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 main handler function that executes the get_case tool logic, including parameter validation, Pega API call, error handling, and response preparation.
      async execute(params) {
        const { caseID, viewType, pageName, originChannel } = 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, ['caseID']);
        if (requiredValidation) {
          return requiredValidation;
        }
    
        // Validate enum parameters using base class
        const enumValidation = this.validateEnumParams(params, {
          viewType: ['none', 'page']
        });
        if (enumValidation) {
          return enumValidation;
        }
    
        // Validate pageName usage
        if (pageName && viewType !== 'page') {
          return {
            error: 'pageName parameter can only be used when viewType is set to "page".'
          };
        }
    
          // Execute with standardized error handling
          return await this.executeWithErrorHandling(
            `Case Details: ${caseID}`,
            async () => await this.pegaClient.getCase(caseID.trim(), { viewType, pageName, originChannel }),
            { caseID, viewType, pageName, originChannel, sessionInfo }
          );
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `## Error: Get Case
    
    **Unexpected Error**: ${error.message}
    
    ${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*`
            }]
          };
        }
      }
  • Defines the tool name, description, and input schema for validation in the MCP protocol.
    static getDefinition() {
      return {
        name: 'get_case',
        description: 'Get comprehensive case information including status, stage, assignments, and available actions. Use AFTER workflow completion or for case overview. Not recommended immediately after create_case (redundant). For working on assignments, use get_assignment instead.',
        inputSchema: {
          type: 'object',
          properties: {
            caseID: {
              type: 'string',
              description: 'Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces.'
            },
            viewType: {
              type: 'string',
              enum: ['none', 'page'],
              description: 'UI resources to return. "none" returns no UI resources, "page" returns full page UI metadata',
              default: 'none'
            },
            pageName: {
              type: 'string',
              description: 'If provided, view metadata for specific page name will be returned (only used when viewType is "page")'
            },
            originChannel: {
              type: 'string',
              description: 'Origin of this service. E.g. - Web, Mobile etc.'
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseID']
        }
      };
    }
  • Overrides the response formatter to include eTag information, session details, and contextual next steps based on case state.
    formatSuccessResponse(operation, data, options = {}) {
      const { caseID, 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`;
      }
      
      // Display eTag information prominently if available
      if (data.eTag) {
        response += '### 🔑 Current eTag Information\n';
        response += `- **eTag**: \`${data.eTag}\`\n`;
        response += '- **Usage**: Use this exact value as eTag parameter for update operations\n';
        response += '- **Format**: ISO date-time representing pxSaveDateTime\n\n';
      }
    
      // Add workflow guidance based on case state
      response += '\n### Next Steps\n\n';
    
      if (data.assignments && data.assignments.length > 0) {
        response += '**Available Assignments**: This case has open assignments:\n';
        data.assignments.forEach(assignment => {
          response += `- Use \`get_assignment\` with ID "${assignment.ID}" to work on this assignment\n`;
        });
      } else if (data.availableProcesses && data.availableProcesses.length > 0) {
        response += '**Available Processes**: This case can have optional processes added:\n';
        data.availableProcesses.forEach(process => {
          response += `- Use \`add_optional_process\` with process ID "${process.ID}"\n`;
        });
      } else {
        response += '**Case Status**: No open assignments. Case may be completed or waiting for external event.\n';
        response += '- Use `get_case_history` to view case audit trail\n';
        response += '- Use `get_case_stages` to view stage progression\n';
      }
    
      // Add the standard data formatting
      if (data && typeof data === 'object') {
        response += this.formatDataSection(data);
      }
      
      return response;
    }
Behavior3/5

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

No annotations are provided, so the description carries full burden. It mentions the tool retrieves 'comprehensive case information' and provides usage timing guidance, but doesn't disclose important behavioral aspects like authentication requirements, rate limits, error conditions, or what 'comprehensive' specifically includes beyond the listed fields. The description adds some context but leaves gaps for a tool with 5 parameters.

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 concise with three sentences that each serve distinct purposes: stating the tool's function, providing usage timing guidance, and offering alternative tool recommendations. Every sentence earns its place with no wasted words or redundancy.

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?

For a tool with 5 parameters (including a complex nested object), no annotations, and no output schema, the description provides good usage guidance but lacks details about authentication requirements, return format, error handling, and what 'comprehensive case information' specifically entails. The description is helpful but incomplete given the tool's complexity and lack of structured metadata.

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 doesn't add any parameter-specific information beyond what's in the schema. It mentions retrieving 'case information' which aligns with the caseID parameter, but provides no additional semantics about parameter usage, relationships, or constraints.

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 and resources: 'Get comprehensive case information including status, stage, assignments, and available actions.' It distinguishes from siblings by explicitly mentioning what information is retrieved and contrasting with other tools like get_assignment.

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 and when not to use this tool: 'Use AFTER workflow completion or for case overview. Not recommended immediately after create_case (redundant). For working on assignments, use get_assignment instead.' It names specific alternatives and timing considerations.

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