Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_case_ancestors

Retrieve the parent-child hierarchy chain for a specific case to understand its lineage and relationships within the Pega platform.

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
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. The case must exist and be accessible to the current user.
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

  • The execute method implements the core tool logic: parameter validation, session initialization, and delegation to PegaClient.getCaseAncestors via 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()}*`
          }]
        };
      }
    }
  • Defines the MCP tool metadata: 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: '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']
        }
      };
    }
  • PegaClient proxy method for getCaseAncestors, routing to v1 or v2 specific implementation based on configuration.
    /**
     * Get case ancestors
     * @param {string} caseID - Case ID
     * @returns {Promise<Object>} Ancestor cases
     */
    async getCaseAncestors(caseID) {
      return this.client.getCaseAncestors(caseID);
    }
  • Dynamic registration code in tool loader that instantiates the tool class and registers it by 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) {
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the return format ('ancestor hierarchy case list', 'basic case information', 'HATEOAS navigation links') which is valuable behavioral context. However, it doesn't mention authentication requirements, rate limits, error conditions, or pagination behavior that would be important for a read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized (three sentences) and front-loaded with the core purpose. Every sentence adds value: first states the action, second elaborates on scope, third describes return format. Minor redundancy exists with 'ancestor hierarchy' appearing twice.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only tool with no annotations and no output schema, the description provides adequate but incomplete context. It covers purpose and return format but lacks authentication guidance, error handling, and performance characteristics. Given the 2 parameters (one complex nested object) and no output schema, more behavioral context would be helpful.

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 description coverage is 100%, so the schema already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. The baseline score of 3 is appropriate when the schema does the heavy lifting for parameter documentation.

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 specific action ('Get ancestor case hierarchy'), target resource ('for a specific case'), and scope ('showing the parent-child relationships up the case hierarchy chain'). It distinguishes from sibling tools like 'get_case_descendants' by specifying direction (ancestors vs descendants).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning 'case ID passed in' and 'must exist and be accessible' (from schema), but doesn't explicitly state when to use this tool versus alternatives like 'get_case' or 'get_related_cases'. No explicit when-not-to-use guidance or named alternatives are provided.

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