delete_data_record
Remove specific data records by providing a Data Page ID and primary key(s). Designed for data object classes, this tool ensures precise deletion based on configured conditional save plans in Pega DX MCP Server.
Instructions
Delete a data record based on conditional save plan configured for a savable Data Page. Only supported on data object classes. Requires primary key(s) to uniquely identify the record to delete.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataViewID | Yes | ID of savable Data Page containing the record to delete. Must be a valid data page identifier configured for delete operations. | |
| dataViewParameters | Yes | Primary key(s) as input to uniquely identify the data record to delete. The exact format depends on the data page configuration and may include multiple key-value pairs. For example: "CustomerID=12345" or "OrderID=O-1001&CustomerID=C-5678". |
Implementation Reference
- The main handler function that destructures parameters, initializes session configuration, validates required params, and executes the delete operation via pegaClient with standardized error handling.async execute(params) { const { dataViewID, dataViewParameters } = params; let sessionInfo = null; try { sessionInfo = this.initializeSessionConfig(params); // Validate required parameters const requiredValidation = this.validateRequiredParams(params, ['dataViewID', 'dataViewParameters']); if (requiredValidation) { return requiredValidation; } // Execute with standardized error handling return await this.executeWithErrorHandling( `Delete Data Record: ${dataViewID}`, async () => await this.pegaClient.deleteDataRecord(dataViewID, dataViewParameters), { sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Delete Data Record: ${dataViewID}\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*` }] }; } }
- Static method providing the tool definition including the name 'delete_data_record', description, and input schema specifying dataViewID and dataViewParameters as required.static getDefinition() { return { name: 'delete_data_record', description: 'Delete a data record based on conditional save plan configured for a savable Data Page. Only supported on data object classes. Requires primary key(s) to uniquely identify the record to delete.', inputSchema: { type: 'object', properties: { dataViewID: { type: 'string', description: 'ID of savable Data Page containing the record to delete. Must be a valid data page identifier configured for delete operations.' }, dataViewParameters: { type: 'string', description: 'Primary key(s) as JSON string to uniquely identify the data record to delete. Must be a valid JSON object containing key-value pairs. For example: "{\\"CustomerID\\": \\"12345\\"}" or "{\\"OrderID\\": \\"O-1001\\", \\"CustomerID\\": \\"C-5678\\"}". Note: String format like "CustomerID=12345" will cause validation errors.' }, sessionCredentials: getSessionCredentialsSchema() }, required: ['dataViewID', 'dataViewParameters'] } }; }
- src/tools/dataviews/delete-data-record.js:8-10 (registration)Static getCategory method returning 'dataviews', used by the tool loader for categorization and dynamic registration.static getCategory() { return 'dataviews'; }
- src/api/pega-client.js:688-690 (helper)Wrapper method in PegaClient class that delegates the deleteDataRecord call to the internal SDK client.async deleteDataRecord(dataViewID, dataViewParameters) { return this.client.deleteDataRecord(dataViewID, dataViewParameters); }