delete_related_case
Remove a specific relationship between two cases by deleting their work association in Pega DX systems.
Instructions
Remove related work association between two cases by deleting a specific relationship
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caseID | Yes | Primary case ID from which to remove the related case. Example: "ON6E5R-DIYRecipe-Work-RecipeCollection R-1008". a complete case identifier including spaces and special characters. | |
| related_caseID | Yes | Related case ID to be removed from the primary case. Example: "ON6E5R-DIYRecipe-Work-RecipeCollection R-1009". a complete case identifier including spaces and special characters. | |
| sessionCredentials | No | Optional 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 for the 'delete_related_case' tool. It validates input parameters, initializes session configuration, calls the PegaClient's deleteRelatedCase method, and handles errors with standardized error reporting.async execute(params) { const { caseID, related_caseID } = params; let sessionInfo = null; try { sessionInfo = this.initializeSessionConfig(params); // Validate required parameters using base class const requiredValidation = this.validateRequiredParams(params, ['caseID', 'related_caseID']); if (requiredValidation) { return requiredValidation; } // Execute with standardized error handling return await this.executeWithErrorHandling( `Delete Related Case: ${related_caseID} from ${caseID}`, async () => await this.pegaClient.deleteRelatedCase(caseID.trim(), related_caseID.trim()), { sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Delete Related Case: ${related_caseID} from ${caseID}\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 and tool metadata definition for 'delete_related_case', including name, description, properties for caseID and related_caseID, and required fields.return { name: 'delete_related_case', description: 'Remove related work association between two cases by deleting a specific relationship', inputSchema: { type: 'object', properties: { caseID: { type: 'string', description: 'Primary case ID from which to remove the related case. Example: "ON6E5R-DIYRecipe-Work-RecipeCollection R-1008". a complete case identifier including spaces and special characters.' }, related_caseID: { type: 'string', description: 'Related case ID to be removed from the primary case. Example: "ON6E5R-DIYRecipe-Work-RecipeCollection R-1009". a complete case identifier including spaces and special characters.' }, sessionCredentials: getSessionCredentialsSchema() }, required: ['caseID', 'related_caseID'] } }; }
- src/api/pega-client.js:972-977 (helper)Helper method in PegaClient class that routes the deleteRelatedCase call to the appropriate API version client (V2 only), checking feature availability first.async deleteRelatedCase(caseID, relatedCaseID) { if (!this.isFeatureAvailable('relatedCases')) { this.throwUnsupportedFeatureError('relatedCases', 'deleteRelatedCase'); } return this.client.deleteRelatedCase(caseID, relatedCaseID); }