Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

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
NameRequiredDescriptionDefault
dataViewIDYesID of savable Data Page containing the record to delete. a valid data page identifier configured for delete operations.
dataViewParametersYesPrimary 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.
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 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';
    }
  • 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);
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that this is a destructive operation ('Delete'), specifies constraints ('Only supported on data object classes'), and mentions authentication requirements indirectly via the sessionCredentials parameter. However, it doesn't describe error conditions, rate limits, or what happens on success/failure. The behavioral context is minimal but covers the core destructive nature.

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 two sentences that efficiently state the tool's purpose and key requirements. It's front-loaded with the main action and avoids unnecessary elaboration. Every sentence earns its place by providing essential context, though it could be slightly more structured with bullet points for constraints.

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?

Given the complexity (destructive operation, 3 parameters, nested objects, no output schema, and no annotations), the description is moderately complete. It covers the what and basic constraints but lacks details on error handling, return values, or side effects. For a deletion tool with significant impact, more behavioral transparency would be beneficial, but it meets minimum viable standards.

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 parameters thoroughly. The description adds minimal value beyond the schema: it mentions 'primary key(s)' which aligns with dataViewParameters, and 'savable Data Page' which relates to dataViewID. No additional syntax or format details are provided that aren't already in the schema descriptions. 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.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Delete a data record based on conditional save plan configured for a savable Data Page.' It specifies the verb ('Delete'), resource ('data record'), and context ('savable Data Page'), distinguishing it from general deletion tools like 'delete_case' or 'delete_attachment' in the sibling list. However, it doesn't explicitly differentiate from 'update_data_record_full' or 'update_data_record_partial' in terms of when deletion vs. update is appropriate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context: 'Only supported on data object classes' and 'Requires primary key(s) to uniquely identify the record to delete.' This implies when to use it (for data object records with primary keys) but doesn't explicitly state when NOT to use it or mention alternatives like 'delete_case' for case data. No explicit guidance on prerequisites beyond the required parameters.

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