add_case_followers
Enable users to follow a case by adding multiple followers with unique IDs, ensuring notifications and updates on case progress are received efficiently.
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
| Name | Required | Description | Default |
|---|---|---|---|
| caseID | Yes | Full case handle (case ID) to add followers to. Example: "OSIEO3-DOCSAPP-WORK T-561003". Must be a complete case identifier including spaces and special characters. | |
| users | Yes | Array of user objects to add as followers to the case. Each user object should contain user identification information. |
Implementation Reference
- The main handler function that implements the 'add_case_followers' tool logic. Validates input parameters (caseID and users array with ID), initializes session, and executes pegaClient.addCaseFollowers with standardized error handling.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()}*` }] }; } }
- Static method providing the MCP tool definition, including name 'add_case_followers', description, and detailed inputSchema specifying caseID (string) and users (array of objects with required ID).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: 'Full case handle (case ID) to add followers to. Example: "OSIEO3-DOCSAPP-WORK T-561003". Must be 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'] } }; }
- src/api/pega-client.js:763-768 (helper)PegaClient router method for addCaseFollowers, checks feature availability (V2 only), and delegates to the version-specific client (PegaV2Client).async addCaseFollowers(caseID, users) { if (!this.isFeatureAvailable('followers')) { this.throwUnsupportedFeatureError('followers', 'addCaseFollowers'); } return this.client.addCaseFollowers(caseID, users); }