Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

add_case_followers

Add multiple followers to a case to receive notifications and updates about case progress.

Instructions

Add multiple followers to a work object. Allows users to follow a case to receive notifications and updates about case progress.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
caseIDYesCase ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces."OSIEO3-DOCSAPP-WORK T-561003". a complete case identifier including spaces and special characters.
usersYesArray of user objects to add as followers to the case. Each user object should contain user identification information.
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

  • Main tool handler class AddCaseFollowersTool extending BaseTool. Contains the execute() method (lines 51-95) that validates params (caseID, users) and calls pegaClient.addCaseFollowers().
    import { BaseTool } from '../../registry/base-tool.js';
    import { getSessionCredentialsSchema } from '../../utils/tool-schema.js';
    
    export class AddCaseFollowersTool extends BaseTool {
      /**
       * Get the category this tool belongs to
       */
      static getCategory() {
        return 'followers';
      }
    
      /**
       * Get tool definition for MCP protocol
       */
      static getDefinition() {
        return {
          name: 'add_case_followers',
          description: 'Add multiple followers to a work object. Allows users to follow a case to receive notifications and updates about case progress.',
          inputSchema: {
            type: 'object',
            properties: {
              caseID: {
                type: 'string',
                description: 'Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces."OSIEO3-DOCSAPP-WORK T-561003". a complete case identifier including spaces and special characters.'
              },
              users: {
                type: 'array',
                description: 'Array of user objects to add as followers to the case. Each user object should contain user identification information.',
                items: {
                  type: 'object',
                  properties: {
                    ID: {
                      type: 'string',
                      description: 'User identifier of the person to add as a follower. This is the unique identifier for the user in the Pega system.'
                    }
                  },
                  required: ['ID']
                },
                minItems: 1
              },
              sessionCredentials: getSessionCredentialsSchema()
            },
            required: ['caseID', 'users']
          }
        };
      }
    
      /**
       * Execute the add case followers operation
       */
      async execute(params) {
        const { caseID, users } = params;
        let sessionInfo = null;
    
        try {
          sessionInfo = this.initializeSessionConfig(params);
    
          // Validate required parameters using base class
          const requiredValidation = this.validateRequiredParams(params, ['caseID', 'users']);
          if (requiredValidation) {
            return requiredValidation;
          }
    
          // Validate users array
          if (!Array.isArray(users) || users.length === 0) {
            return {
              error: 'users parameter must be a non-empty array of user objects.'
            };
          }
    
          // Validate each user object
          for (let i = 0; i < users.length; i++) {
            const user = users[i];
            if (!user.ID) {
              return {
                error: `User at index ${i} is missing required ID field.`
              };
            }
          }
    
          // Execute with standardized error handling
          return await this.executeWithErrorHandling(
            `Add Case Followers: ${caseID}`,
            async () => await this.pegaClient.addCaseFollowers(caseID.trim(), users),
            { sessionInfo }
          );
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `## Error: Add Case Followers: ${caseID}\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*`
            }]
          };
        }
      }
  • Input schema definition for add_case_followers tool. Defines required parameters: caseID (string), users (array of objects with required 'ID' field), and optional sessionCredentials.
    static getDefinition() {
      return {
        name: 'add_case_followers',
        description: 'Add multiple followers to a work object. Allows users to follow a case to receive notifications and updates about case progress.',
        inputSchema: {
          type: 'object',
          properties: {
            caseID: {
              type: 'string',
              description: 'Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces."OSIEO3-DOCSAPP-WORK T-561003". a complete case identifier including spaces and special characters.'
            },
            users: {
              type: 'array',
              description: 'Array of user objects to add as followers to the case. Each user object should contain user identification information.',
              items: {
                type: 'object',
                properties: {
                  ID: {
                    type: 'string',
                    description: 'User identifier of the person to add as a follower. This is the unique identifier for the user in the Pega system.'
                  }
                },
                required: ['ID']
              },
              minItems: 1
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseID', 'users']
        }
      };
  • Tools are dynamically discovered and registered by scanning the tools/followers directory. The loadToolFile method (lines 150-207) imports the module, finds the tool class, validates it, checks config, and registers it in the loadedTools map with tool name 'add_case_followers'.
    async loadToolFile(categoryPath, filename, category) {
      const filePath = resolve(categoryPath, filename);
      const fileUrl = pathToFileURL(filePath).href;
      
      try {
        const module = await import(fileUrl);
        
        // Find the tool class in the module
        const ToolClass = this.findToolClass(module);
        if (!ToolClass) {
          return {
            loaded: false,
            toolName: filename.replace('.js', ''),
            reason: 'No valid tool class found'
          };
        }
        
        // Validate tool class
        const validationResult = this.validateToolClass(ToolClass, category, filename);
        if (!validationResult.valid) {
          return {
            loaded: false,
            toolName: filename.replace('.js', ''),
            reason: validationResult.reason
          };
        }
        
        // Get tool name from definition
  • PegaClient.addCaseFollowers() - API client helper method that delegates to the underlying client, with feature availability check for 'followers' (V2-only feature).
    /**
     * Add case followers
     * V2 ONLY
     * @param {string} caseID - Case ID
     * @param {Array} users - Users array
     * @returns {Promise<Object>} Addition result
     */
    async addCaseFollowers(caseID, users) {
      if (!this.isFeatureAvailable('followers')) {
        this.throwUnsupportedFeatureError('followers', 'addCaseFollowers');
      }
      return this.client.addCaseFollowers(caseID, users);
    }
  • Tool name 'add_case_followers' defined in getDefinition() static method (line 17), which is used by the configurable loader to register the tool.
    static getDefinition() {
      return {
        name: 'add_case_followers',
        description: 'Add multiple followers to a work object. Allows users to follow a case to receive notifications and updates about case progress.',
        inputSchema: {
          type: 'object',
          properties: {
            caseID: {
              type: 'string',
              description: 'Case ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces."OSIEO3-DOCSAPP-WORK T-561003". a complete case identifier including spaces and special characters.'
            },
            users: {
              type: 'array',
              description: 'Array of user objects to add as followers to the case. Each user object should contain user identification information.',
              items: {
                type: 'object',
                properties: {
                  ID: {
                    type: 'string',
                    description: 'User identifier of the person to add as a follower. This is the unique identifier for the user in the Pega system.'
                  }
                },
                required: ['ID']
              },
              minItems: 1
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseID', 'users']
        }
      };
Behavior2/5

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

With no annotations, the description carries full burden but only mentions the basic action. It does not disclose whether duplicates are handled, permissions required, or what happens on failure. This is minimal behavioral context.

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, no wasted words, front-loading the key information.

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?

Lacks details on return values, error handling, prerequisites (e.g., case existence), and whether followers are appended or replaced. Incomplete for a mutation tool with no output schema or annotations.

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%, so each parameter is already described in the schema. The description adds little beyond restating the action; baseline 3 is appropriate.

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 the action 'Add multiple followers' and the resource 'work object/case', distinguishing it from sibling tools like delete_case_follower and get_case_followers.

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 explicit guidance on when to use this tool versus alternatives (e.g., adding followers individually or via other methods). The description only states what it does without context on prerequisites or exclusions.

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