delete_data_record
Remove specific data records from Pega data object classes by providing primary keys and a savable Data Page identifier configured for deletion operations.
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. a valid data page identifier configured for delete operations. | |
| dataViewParameters | Yes | Primary key(s) as JSON string to uniquely identify the data record to delete. 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 | 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 execute() method is the main handler for the 'delete_data_record' tool. It extracts parameters, initializes session configuration if provided, validates required inputs, and executes the deletion via pegaClient.deleteDataRecord with comprehensive 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()}*` }] }; } }
- The static getDefinition() method defines the tool schema for MCP, including name 'delete_data_record', description, and inputSchema with properties for dataViewID, dataViewParameters (JSON string of primary keys), and optional sessionCredentials.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. 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. 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'] } }; }
- Static getCategory() returns 'dataviews', used by the loader to categorize and discover the tool.static getCategory() { return 'dataviews'; }
- src/api/pega-client.js:688-690 (helper)PegaClient.deleteDataRecord method, called by the tool handler, delegates the actual API call to the version-specific client (v1 or v2).async deleteDataRecord(dataViewID, dataViewParameters) { return this.client.deleteDataRecord(dataViewID, dataViewParameters); }