Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_participant_roles

Retrieves participant roles assigned to a specific Pega case, enabling access control and permission management for case participants.

Instructions

Retrieve list of participant roles for a specific Pega case. Returns available roles that can be assigned to case participants for access control and permission management.

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.
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 of GetParticipantRolesTool - the main handler that validates inputs and calls pegaClient.getParticipantRoles(caseID.trim())
    async execute(params) {
      const { caseID } = params;
      let sessionInfo = null;
    
      try {
        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(
          `Participant Roles: ${caseID}`,
          async () => await this.pegaClient.getParticipantRoles(caseID.trim()),
          { caseID: caseID.trim(), sessionInfo }
        );
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `## Error: Participant Roles: ${caseID}\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*`
          }]
        };
      }
    }
  • Tool definition and inputSchema - defines the 'get_participant_roles' tool name, description, and input schema requiring caseID (string) with optional sessionCredentials
    static getDefinition() {
      return {
        name: 'get_participant_roles',
        description: 'Retrieve list of participant roles for a specific Pega case. Returns available roles that can be assigned to case participants for access control and permission management.',
        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.'
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseID']
        }
      };
    }
  • The ToolLoader.loadToolFile() method that dynamically discovers and registers tools including GetParticipantRolesTool by scanning the participants directory and calling getDefinition().name
    }
    
    /**
     * Scan for tool categories (subdirectories in tools/)
     * @returns {Promise<Array>} Array of category names
     */
    async scanCategories() {
      try {
        const entries = await fs.readdir(this.toolsPath, { withFileTypes: true });
        const categories = [];
        
        for (const entry of entries) {
          if (entry.isDirectory()) {
            categories.push(entry.name);
          }
        }
        
        return categories.sort();
      } catch (error) {
        if (error.code === 'ENOENT') {
          console.warn(`Tools directory not found: ${this.toolsPath}`);
          return [];
        }
        throw error;
      }
    }
    
    /**
     * Load all tools from a specific category directory
     * @param {string} category - Category name
     * @returns {Promise<Array>} Array of tool class instances
     */
    async loadCategoryTools(category) {
      const categoryPath = resolve(this.toolsPath, category);
      const tools = [];
      
      try {
        const files = await fs.readdir(categoryPath);
        const jsFiles = files.filter(file => file.endsWith('.js'));
        
        for (const file of jsFiles) {
          try {
            const tool = await this.loadToolFile(categoryPath, file, category);
            if (tool) {
              tools.push(tool);
            }
          } catch (error) {
            console.warn(`Failed to load tool ${file} in category ${category}:`, error.message);
            // Continue loading other tools even if one fails
          }
        }
        
        return tools.sort((a, b) => a.constructor.name.localeCompare(b.constructor.name));
      } catch (error) {
        console.warn(`Failed to read category directory ${category}:`, error.message);
        return [];
      }
    }
    
    /**
     * Load a single tool file
     * @param {string} categoryPath - Path to category directory
     * @param {string} filename - Tool filename
     * @param {string} category - Category name
     * @returns {Promise<Object|null>} Tool instance or null if invalid
     */
    async loadToolFile(categoryPath, filename, category) {
  • The PegaClient.getParticipantRoles() method - delegates to the underlying API client, with a feature availability check for 'participants'
    async getParticipantRoles(caseID) {
      if (!this.isFeatureAvailable('participants')) {
        this.throwUnsupportedFeatureError('participants', 'getParticipantRoles');
      }
      return this.client.getParticipantRoles(caseID);
  • The getSessionCredentialsSchema() utility used by the tool's input schema to define optional session credential parameters
    export function getSessionCredentialsSchema() {
      return {
        type: 'object',
        description: '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.',
        properties: {
          sessionId: {
            type: 'string',
            description: 'Optional session ID. If not provided, a new session will be created.'
          },
          baseUrl: {
            type: 'string',
            description: 'Pega base URL (required if providing credentials)'
          },
          apiVersion: {
            type: 'string',
            description: 'API version (optional, defaults to v2)',
            default: 'v2'
          },
          clientId: {
            type: 'string',
            description: 'OAuth2 client ID (required for OAuth mode)'
          },
          clientSecret: {
            type: 'string',
            description: 'OAuth2 client secret (required for OAuth mode)'
          },
          accessToken: {
            type: 'string',
            description: 'Direct access token (required for token mode)'
          },
          tokenExpiry: {
            type: 'number',
            description: 'Token expiry in seconds from now (optional for token mode)'
          }
        }
      };
    }
Behavior3/5

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

The description indicates a read-only operation but lacks details on authentication needs, permissions required, or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences that convey the purpose without extraneous information.

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

Completeness4/5

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

Adequate for a simple retrieval tool; mentions the purpose and domain but could elaborate on return value structure or relationship to sibling tools.

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 coverage is 100%, and the description adds no additional parameter semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

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

The description clearly states it retrieves a list of participant roles for a specific Pega case, distinguishing it from sibling tools like get_participant or get_participant_role_details.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives, or any prerequisites or constraints.

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