get_case_ancestors
Retrieve the ancestor hierarchy for a specified case ID to view parent-child relationships and basic case details. This tool supports HATEOAS navigation links for streamlined case hierarchy exploration.
Instructions
Get ancestor case hierarchy for a specific case. Retrieves ancestor hierarchy case list for the case ID passed in, showing the parent-child relationships up the case hierarchy chain. Each ancestor includes basic case information (ID, name) and HATEOAS navigation links.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caseID | Yes | Full case handle (case ID) to retrieve ancestors from. Example: "OSIEO3-DOCSAPP-WORK T-561003". Must be a complete case identifier including spaces and special characters. The case must exist and be accessible to the current user. |
Implementation Reference
- The execute method implements the core logic of the get_case_ancestors MCP tool. It extracts the caseID parameter, initializes session configuration if provided, validates required inputs, and calls pegaClient.getCaseAncestors 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 Ancestors: ${caseID}`, async () => await this.pegaClient.getCaseAncestors(caseID.trim()), { caseID, sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Get Case Ancestors\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 'get_case_ancestors', description, and input schema requiring 'caseID' with optional sessionCredentials.static getDefinition() { return { name: 'get_case_ancestors', description: 'Get ancestor case hierarchy for a specific case. Retrieves ancestor hierarchy case list for the case ID passed in, showing the parent-child relationships up the case hierarchy chain. Each ancestor includes basic case information (ID, name) and HATEOAS navigation links.', inputSchema: { type: 'object', properties: { caseID: { type: 'string', description: 'Full case handle (case ID) to retrieve ancestors from. Example: "OSIEO3-DOCSAPP-WORK T-561003". Must be 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/registry/tool-loader.js:123-134 (registration)In loadToolFile method, dynamically instantiates GetCaseAncestorsTool and registers it in loadedTools map using its name from getDefinition() during directory scan of src/tools/cases.const toolInstance = new ToolClass(); const toolName = ToolClass.getDefinition().name; this.loadedTools.set(toolName, { instance: toolInstance, class: ToolClass, category: category, filename: filename }); return toolInstance; } catch (error) {
- src/api/pega-client.js:236-238 (helper)PegaClient proxy method that delegates getCaseAncestors call to the version-specific client (PegaV1Client or PegaV2Client).async getCaseAncestors(caseID) { return this.client.getCaseAncestors(caseID); }