add_case_followers
Add users as followers to a Pega case to enable them 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
| Name | Required | Description | Default |
|---|---|---|---|
| caseID | Yes | 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 | Yes | Array of user objects to add as followers to the case. Each user object should contain user identification information. | |
| sessionCredentials | No | 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. |
Implementation Reference
- The main handler function that implements the tool logic: validates caseID and users array (each with ID), initializes session, and executes pegaClient.addCaseFollowers with 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()}*` }] }; } }
- Input schema defining parameters: caseID (string), users (array of objects with required ID string, minItems 1), and optional sessionCredentials.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'] }
- src/tools/followers/add-case-followers.js:15-46 (registration)Tool definition including name 'add_case_followers', description, and inputSchema. Used by the dynamic 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'] } }; }
- src/api/pega-client.js:763-768 (helper)Helper method in PegaClient wrapper that checks feature availability and delegates to the underlying client.addCaseFollowers.async addCaseFollowers(caseID, users) { if (!this.isFeatureAvailable('followers')) { this.throwUnsupportedFeatureError('followers', 'addCaseFollowers'); } return this.client.addCaseFollowers(caseID, users); }