get_case_descendants
Retrieve all child cases, assignments, and actions from a specific case instance by recursively descending through its hierarchy to analyze case relationships and dependencies.
Instructions
Get descendants of a case instance. This API loops through all the child cases recursively descending from the specific one, and returns the assignments and actions for each. If the current user does not have access to a given child case, they can only see limited information, and can not drill down into any child cases.
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. The case must exist and be accessible to the current user. | |
| 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 execute method implements the core logic of the get_case_descendants tool, handling input validation, session initialization, and delegation to PegaClient.getCaseDescendants with standardized error handling.async execute(params) { const { caseID } = params; let sessionInfo = null; try { // Initialize session configuration if provided 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( `Case Descendants: ${caseID}`, async () => await this.pegaClient.getCaseDescendants(caseID.trim()), { caseID, sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Get Case Descendants\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*` }] }; } }
- Defines the tool schema including name 'get_case_descendants', detailed description, and input schema requiring 'caseID' with optional session credentials.static getDefinition() { return { name: 'get_case_descendants', description: 'Get descendants of a case instance. This API loops through all the child cases recursively descending from the specific one, and returns the assignments and actions for each. If the current user does not have access to a given child case, they can only see limited information, and can not drill down into any child cases.', 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. The case must exist and be accessible to the current user.' }, sessionCredentials: getSessionCredentialsSchema() }, required: ['caseID'] } }; }
- src/api/pega-client.js:223-229 (helper)PegaClient helper method that routes getCaseDescendants to the appropriate V1 or V2 API client implementation.* Get case descendants * @param {string} caseID - Case ID * @returns {Promise<Object>} Descendant cases */ async getCaseDescendants(caseID) { return this.client.getCaseDescendants(caseID); }