Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

bulk_cases_patch

Perform case-wide actions on multiple Pega cases simultaneously using the PATCH API endpoint. Supports synchronous execution in Infinity and asynchronous background processing in Launchpad.

Instructions

Perform case action on multiple cases simultaneously using PATCH /api/application/v2/cases endpoint. In Infinity, actions are performed synchronously. In Launchpad, actions are performed asynchronously in the background. Only supports case-wide actions that update cases directly - assignment-level actions like Transfer and Adjust Assignment SLA are not supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionIDYesAction ID for case/stage 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 to find correct ID from availableActions array - use "ID" field not "name" field. This action must be a case-wide action that updates cases directly.
casesYesArray of case objects to perform the action on. Each case object must contain an ID property with the full case handle. Cannot be empty.
runningModeNoExecution mode for Launchpad only. "async" schedules the action to be performed in the background rather than immediately. Not applicable for Infinity which always executes synchronously. Currently, only async runningMode is implemented in Launchpad.
contentNoA map of scalar properties and embedded page properties to be set during action execution. Same format as single case action content.
pageInstructionsNoOptional list of page-related operations for embedded pages, page lists, or page groups. Required for setting embedded page references.
attachmentsNoA list of attachments to be added to specific attachment fields during action execution.
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 BulkCasesPatchTool class that implements the core logic for the bulk_cases_patch tool. It validates parameters, handles sessions, and calls pegaClient.patchCasesBulk to perform the bulk PATCH operation on cases.
    async execute(params) {
      const { actionID, cases, runningMode, content, pageInstructions, attachments } = params;
      let sessionInfo = null;
    
      try {
        // Initialize session configuration if provided
        sessionInfo = this.initializeSessionConfig(params);
    
      // 1. Basic parameter validation using base class
      const requiredValidation = this.validateRequiredParams(params, ['actionID', 'cases']);
      if (requiredValidation) {
        return requiredValidation;
      }
    
      // 2. Validate actionID is not empty
      if (!actionID || typeof actionID !== 'string' || actionID.trim() === '') {
        return {
          error: 'Invalid actionID parameter. ActionID must be a non-empty string containing the case action ID.'
        };
      }
    
      // 3. Validate cases array (exact specification from WIP.md)
      if (!Array.isArray(cases)) {
        return {
          error: 'Cases missing from the request body or empty. Cases must be provided as a non-empty array.'
        };
      }
    
      if (cases.length === 0) {
        return {
          error: 'Cases missing from the request body or empty. At least one case must be provided for bulk processing.'
        };
      }
    
      // Validate each case object has required ID property
      for (let i = 0; i < cases.length; i++) {
        const caseObj = cases[i];
        if (!caseObj || typeof caseObj !== 'object') {
          return {
            error: `Invalid case object at index ${i}. Each case must be an object with an ID property containing the full case handle.`
          };
        }
        if (!caseObj.ID || typeof caseObj.ID !== 'string' || caseObj.ID.trim() === '') {
          return {
            error: `Cases missing from the request body or empty. Case at index ${i} does not contain the required ID property.`
          };
        }
      }
    
      // 4. Validate enum parameters - runningMode if provided
      if (runningMode !== undefined) {
        const enumValidation = this.validateEnumParams(params, {
          runningMode: ['async']
        });
        if (enumValidation) {
          return enumValidation;
        }
      }
    
      // 5. Validate optional complex parameters
      if (content !== undefined && (typeof content !== 'object' || Array.isArray(content))) {
        return {
          error: 'Invalid content parameter. an object containing scalar properties and embedded page properties.'
        };
      }
    
      if (pageInstructions !== undefined && !Array.isArray(pageInstructions)) {
        return {
          error: 'Invalid pageInstructions parameter. an array of page-related operations.'
        };
      }
    
      if (attachments !== undefined && !Array.isArray(attachments)) {
        return {
          error: 'Invalid attachments parameter. an array of attachment objects.'
        };
      }
    
        // 6. Execute with standardized error handling
        return await this.executeWithErrorHandling(
          `Bulk Cases PATCH: ${actionID} on ${cases.length} cases`,
          async () => await this.pegaClient.patchCasesBulk(actionID.trim(), {
            cases,
            runningMode,
            content,
            pageInstructions,
            attachments
          }),
          { actionID, cases, runningMode, content, pageInstructions, attachments, sessionInfo }
        );
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `## Error: Bulk Cases PATCH\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*`
          }]
        };
      }
    }
  • The input schema definition for the bulk_cases_patch tool, including validation rules for parameters like actionID, cases array, runningMode, content, pageInstructions, and attachments.
    static getDefinition() {
      return {
        name: 'bulk_cases_patch',
        description: 'Perform case action on multiple cases simultaneously using PATCH /api/application/v2/cases endpoint. In Infinity, actions are performed synchronously. In Launchpad, actions are performed asynchronously in the background. Only supports case-wide actions that update cases directly - assignment-level actions like Transfer and Adjust Assignment SLA are not supported.',
        inputSchema: {
          type: 'object',
          properties: {
            actionID: {
              type: 'string',
              description: 'Action ID for case/stage 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 to find correct ID from availableActions array - use "ID" field not "name" field. This action must be a case-wide action that updates cases directly.'
            },
            cases: {
              type: 'array',
              description: 'Array of case objects to perform the action on. Each case object must contain an ID property with the full case handle. Cannot be empty.',
              items: {
                type: 'object',
                properties: {
                  ID: {
                    type: 'string',
                    description: 'Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces.'
                  }
                },
                required: ['ID']
              },
              minItems: 1
            },
            runningMode: {
              type: 'string',
              enum: ['async'],
              description: 'Execution mode for Launchpad only. "async" schedules the action to be performed in the background rather than immediately. Not applicable for Infinity which always executes synchronously. Currently, only async runningMode is implemented in Launchpad.'
            },
            content: {
              type: 'object',
              description: 'A map of scalar properties and embedded page properties to be set during action execution. Same format as single case action content.'
            },
            pageInstructions: {
              type: 'array',
              items: {
                type: 'object',
                properties: {
                  instruction: {
                    type: 'string',
                    enum: ['UPDATE', 'REPLACE', 'DELETE', 'APPEND', 'INSERT', 'MOVE'],
                    description: 'Page instruction type. UPDATE (add fields to page), REPLACE (replace entire page), DELETE (remove page), APPEND (add item to page list), INSERT (insert item in page list), MOVE (reorder page list items)'
                  },
                  target: {
                    type: 'string',
                    description: 'Target embedded page name'
                  },
                  content: {
                    type: 'object',
                    description: 'Content to set on the embedded page (required for UPDATE and REPLACE)'
                  }
                },
                required: ['instruction', 'target'],
                description: 'Page operation for embedded pages. Use REPLACE instruction to set embedded page references with full object including pzInsKey. Example: {"instruction": "REPLACE", "target": "PageName", "content": {"Property": "value", "pyID": "ID-123", "pzInsKey": "CLASS-NAME ID-123"}}'
              },
              description: 'Optional list of page-related operations for embedded pages, page lists, or page groups. Required for setting embedded page references.'
            },
            attachments: {
              type: 'array',
              description: 'A list of attachments to be added to specific attachment fields during action execution.',
              items: {
                type: 'object'
              }
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['actionID', 'cases']
        }
      };
    }
  • Tool name registration within the getDefinition method.
    name: 'bulk_cases_patch',
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 of behavioral disclosure. It effectively describes key behavioral traits: the synchronous vs asynchronous execution differences between Infinity and Launchpad environments, and the limitation to case-wide actions. However, it doesn't mention potential side effects like rate limits, error handling, or what happens if some cases fail in the batch.

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 with three sentences that each serve a distinct purpose: stating the core function, explaining execution behavior differences, and specifying limitations. It's front-loaded with the main purpose and wastes no words, though it could be slightly more concise by combining some information.

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 complex mutation tool with 7 parameters, no annotations, and no output schema, the description provides good context about execution behavior and limitations. However, it doesn't explain what the tool returns (success/failure indicators, error formats, or result details), which is a significant gap for a bulk operation tool with no output schema.

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 7 parameters thoroughly. The description doesn't add any meaningful parameter semantics beyond what's in the schema - it mentions 'case-wide actions' which relates to actionID but doesn't provide additional context about parameters. Baseline 3 is appropriate when schema does the heavy lifting.

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 performs 'case action on multiple cases simultaneously' using a specific PATCH endpoint, distinguishing it from single-case actions like perform_case_action. It specifies the scope ('multiple cases') and method ('PATCH'), making the purpose explicit and distinct from siblings.

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 this tool vs alternatives: it states 'Only supports case-wide actions that update cases directly - assignment-level actions like Transfer and Adjust Assignment SLA are not supported.' This clearly delineates its scope from assignment-focused tools and specifies the type of actions supported.

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