delete_case
Remove a case that is still in the creation stage using its complete case ID. This tool helps clean up draft cases before they progress further in the workflow.
Instructions
Delete a case that is currently in the create stage
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caseID | Yes | Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces. | |
| 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
- src/tools/cases/delete-case.js:36-68 (handler)The execute method implements the core logic of the delete_case MCP tool. It validates the caseID parameter, handles session configuration, performs the deletion via pegaClient.deleteCase, and formats success/error responses.async execute(params) { const { caseID } = 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; } // Execute with standardized error handling return await this.executeWithErrorHandling( `Case Deletion: ${caseID}`, async () => await this.pegaClient.deleteCase(caseID.trim()), { caseID, sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Delete Case **Unexpected Error**: ${error.message} ${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*` }] }; } }
- src/tools/cases/delete-case.js:15-31 (schema)Defines the MCP tool schema including name 'delete_case', description, and inputSchema requiring 'caseID' string parameter.static getDefinition() { return { name: 'delete_case', description: 'Delete a case that is currently in the create stage', inputSchema: { type: 'object', properties: { caseID: { type: 'string', description: 'Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces.' }, sessionCredentials: getSessionCredentialsSchema() }, required: ['caseID'] } }; }
- src/api/pega-client.js:199-201 (helper)The PegaClient.deleteCase method called by the tool handler to perform the actual API deletion by routing to the appropriate version-specific client (v1 or v2).async deleteCase(caseID) { return this.client.deleteCase(caseID); }