Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

create_case_participant

Add users as participants to Pega cases with specific roles and permissions. Assign access control and manage case collaboration by providing participant details and role assignments.

Instructions

Create a new participant in a Pega case with specified role and participant information. If no eTag is provided, automatically fetches the latest eTag from the case for seamless operation. Adds users to case access control with appropriate permissions and role assignments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
caseIDYesCase ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces."ON6E5R-DIYRecipe-Work-RecipeCollection R-1008". a complete case identifier including spaces and special characters.
eTagNoOptional. Auto-fetched if omitted. For faster execution, use eTag from previous response.
contentYesParticipant information object containing user details such as name, email, phone, and other contact information. Structure matches Data-Party schema.
participantRoleIDYesRole ID to assign to the participant. This determines the permissions and access level the participant will have for the case.
viewTypeNoUI resources to return. "form" returns form UI metadata, "none" returns no UI resources (default: "form")form
pageInstructionsNoOptional list of page-related operations for embedded pages, page lists, or page groups. Required for setting embedded page references.
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 main execute handler for the 'create_case_participant' tool. Validates inputs, auto-fetches eTag if not provided by calling getCase, then invokes pegaClient.createCaseParticipant with prepared options, and handles errors with detailed logging.
      async execute(params) {
        const { caseID, eTag, content, participantRoleID, viewType, pageInstructions } = params;
        let sessionInfo = null;
    
        try {
          sessionInfo = this.initializeSessionConfig(params);
    
          // Validate required parameters using base class
          const requiredValidation = this.validateRequiredParams(params, ['caseID', 'content', 'participantRoleID']);
          if (requiredValidation) {
            return requiredValidation;
          }
    
          // Validate enum parameters
          const enumValidation = this.validateEnumParams(params, {
            viewType: ['form', 'none']
          });
          if (enumValidation) {
            return enumValidation;
          }
    
          // Auto-fetch eTag if not provided
          let finalETag = eTag;
          let autoFetchedETag = false;
    
          if (!finalETag) {
            try {
              console.log(`Auto-fetching latest eTag for participant operation on ${caseID}...`);
              const caseResponse = await this.pegaClient.getCase(caseID.trim());
    
              if (!caseResponse || !caseResponse.success) {
                const errorMsg = `Failed to auto-fetch eTag: ${caseResponse?.error?.message || 'Unknown error'}`;
                return {
                  error: errorMsg
                };
              }
    
              finalETag = caseResponse.eTag;
              autoFetchedETag = true;
              console.log(`Successfully auto-fetched eTag: ${finalETag}`);
    
              if (!finalETag) {
                const errorMsg = 'Auto-fetch succeeded but no eTag was returned from get_case. This may indicate a server issue.';
                return {
                  error: errorMsg
                };
              }
            } catch (error) {
              const errorMsg = `Failed to auto-fetch eTag: ${error.message}`;
              return {
                error: errorMsg
              };
            }
          }
    
          // Validate eTag format (should be a timestamp-like string)
          if (typeof finalETag !== 'string' || finalETag.trim().length === 0) {
            return {
              error: 'Invalid eTag parameter. a non-empty string representing case save date time.'
            };
          }
    
          return await this.executeWithErrorHandling(
            `Create Participant: ${caseID}`,
            async () => await this.pegaClient.createCaseParticipant(caseID.trim(), {
              eTag: finalETag,
              content,
              participantRoleID,
              viewType,
              pageInstructions
            }),
            { caseID: caseID.trim(), participantRoleID, sessionInfo }
          );
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `## Error: Create Participant: ${caseID}\\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 MCP tool definition including name 'create_case_participant', detailed description, and comprehensive inputSchema with properties, types, descriptions, enums, and required fields.
    static getDefinition() {
      return {
        name: 'create_case_participant',
        description: 'Create a new participant in a Pega case with specified role and participant information. If no eTag is provided, automatically fetches the latest eTag from the case for seamless operation. Adds users to case access control with appropriate permissions and role assignments.',
        inputSchema: {
          type: 'object',
          properties: {
            caseID: {
              type: 'string',
              description: 'Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces."ON6E5R-DIYRecipe-Work-RecipeCollection R-1008". a complete case identifier including spaces and special characters.'
            },
            eTag: {
              type: 'string',
              description: 'Optional. Auto-fetched if omitted. For faster execution, use eTag from previous response.'
            },
            content: {
              type: 'object',
              description: 'Participant information object containing user details such as name, email, phone, and other contact information. Structure matches Data-Party schema.',
              properties: {
                pyFirstName: { type: 'string', description: 'First name of the participant' },
                pyLastName: { type: 'string', description: 'Last name of the participant' },
                pyEmail1: { type: 'string', description: 'Email address of the participant' },
                pyPhoneNumber: { type: 'string', description: 'Phone number of the participant' },
                pyWorkPartyUri: { type: 'string', description: 'Unique identifier for the participant' },
                pyFullName: { type: 'string', description: 'Full name of the participant' },
                pyTitle: { type: 'string', description: 'Title of the participant' }
              }
            },
            participantRoleID: {
              type: 'string',
              description: 'Role ID to assign to the participant. This determines the permissions and access level the participant will have for the case.'
            },
            viewType: {
              type: 'string',
              enum: ['form', 'none'],
              description: 'UI resources to return. "form" returns form UI metadata, "none" returns no UI resources (default: "form")',
              default: 'form'
            },
            pageInstructions: {
              type: 'array',
              items: {
                type: 'object',
                properties: {
                  instruction: {
                    type: 'string',
                    enum: ['UPDATE', 'REPLACE', 'DELETE', 'APPEND', 'INSERT', 'MOVE'],
                    description: 'Page instruction type. UPDATE (add fields to page), REPLACE (replace entire page), DELETE (remove page), APPEND (add item to page list), INSERT (insert item in page list), MOVE (reorder page list items)'
                  },
                  target: {
                    type: 'string',
                    description: 'Target embedded page name'
                  },
                  content: {
                    type: 'object',
                    description: 'Content to set on the embedded page (required for UPDATE and REPLACE)'
                  }
                },
                required: ['instruction', 'target'],
                description: 'Page operation for embedded pages. Use REPLACE instruction to set embedded page references with full object including pzInsKey. Example: {"instruction": "REPLACE", "target": "PageName", "content": {"Property": "value", "pyID": "ID-123", "pzInsKey": "CLASS-NAME ID-123"}}'
              },
              description: 'Optional list of page-related operations for embedded pages, page lists, or page groups. Required for setting embedded page references.'
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseID', 'content', 'participantRoleID']
        }
      };
    }
  • PegaClient wrapper method for creating case participants. Checks feature availability and delegates to the underlying client.createCaseParticipant, which is called by the tool handler.
    async createCaseParticipant(caseID, options = {}) {
      if (!this.isFeatureAvailable('participants')) {
        this.throwUnsupportedFeatureError('participants', 'createCaseParticipant');
      }
      return this.client.createCaseParticipant(caseID, options);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions automatic eTag fetching and that it 'adds users to case access control with appropriate permissions', which provides some context about the tool's effects. However, it doesn't cover important behavioral aspects like whether this is a write operation (implied but not stated), potential side effects, error conditions, or response format, leaving significant gaps for a mutation tool.

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 efficiently structured in two sentences that cover the core purpose and key behavioral feature (eTag auto-fetching). It's appropriately sized for the tool's complexity, though the second sentence could be more concise by combining the access control and role assignment concepts.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what happens on success/failure, what the return value contains, or important behavioral constraints. The description focuses only on the creation aspect without addressing the broader context needed for safe and effective tool invocation.

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 7 parameters thoroughly. The description adds minimal value beyond the schema - it mentions the eTag auto-fetching behavior and that participant information matches Data-Party schema, but doesn't provide additional semantic context about parameter interactions or usage patterns. Baseline 3 is appropriate when the 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 verb 'Create' and resource 'participant in a Pega case', specifying the action and target. It distinguishes from siblings like 'update_participant' by focusing on creation, but doesn't explicitly differentiate from other participant-related tools like 'get_participant' or 'delete_participant' beyond the creation aspect.

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 implies usage for adding participants to cases with roles and permissions, but provides no explicit guidance on when to use this versus alternatives like 'update_participant' or 'add_case_followers'. It mentions automatic eTag fetching as a convenience feature, which hints at usage context, but lacks clear when-to-use or when-not-to-use statements.

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