Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

add_case_tags

Add multiple tags to a Pega case to organize, categorize, and improve case management workflows by applying structured labels.

Instructions

Add multiple tags to a case

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.
tagsYesArray of tag objects to add to the case. Each tag object must contain a Name property.
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 main handler function that validates input parameters (caseID and tags array), initializes the Pega session, and executes the addCaseTags API call via pegaClient with standardized error handling.
    async execute(params) {
      const { caseID, tags } = params;
      let sessionInfo = null;
    
      try {
        sessionInfo = this.initializeSessionConfig(params);
    
        // Validate required parameters using base class
        const requiredValidation = this.validateRequiredParams(params, ['caseID', 'tags']);
        if (requiredValidation) {
          return requiredValidation;
        }
    
        // Additional validation for tags array
        if (!Array.isArray(tags) || tags.length === 0) {
          return {
            error: 'Invalid tags parameter. tags must be a non-empty array of tag objects.'
          };
        }
    
        // Validate each tag object has required Name property
        for (let i = 0; i < tags.length; i++) {
          const tag = tags[i];
          if (!tag || typeof tag !== 'object' || !tag.Name || typeof tag.Name !== 'string' || tag.Name.trim() === '') {
            return {
              error: `Invalid tag at index ${i}. Each tag must be an object with a non-empty Name property.`
            };
          }
        }
    
        // Execute with standardized error handling
        return await this.executeWithErrorHandling(
          `Add Tags to Case: ${caseID}`,
          async () => await this.pegaClient.addCaseTags(caseID.trim(), tags),
          { sessionInfo }
        );
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `## Error: Add Tags to Case: ${caseID}\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 'add_case_tags', description, and input validation schema requiring caseID (string) and tags (array of objects with Name, 1-50 items).
    static getDefinition() {
      return {
        name: 'add_case_tags',
        description: 'Add multiple tags to a case',
        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.'
            },
            tags: {
              type: 'array',
              description: 'Array of tag objects to add to the case. Each tag object must contain a Name property.',
              items: {
                type: 'object',
                properties: {
                  Name: {
                    type: 'string',
                    description: 'Name of the tag to add to the case'
                  }
                },
                required: ['Name'],
                additionalProperties: false
              },
              minItems: 1,
              maxItems: 50
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseID', 'tags']
        }
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose whether this is idempotent (e.g., adding duplicate tags), what happens on error, if it requires specific permissions, or the response format. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and easy to parse for an AI agent.

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

Completeness2/5

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

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what the tool returns, error conditions, side effects, or how it fits into the broader tagging system. Given the complexity implied by the input schema (e.g., authentication modes), more context is needed for safe and effective use.

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 fully documents all three parameters. The description adds no additional meaning beyond implying 'multiple tags' (which the schema's array type already indicates). Baseline 3 is appropriate when the schema does all the heavy lifting, though the description could have clarified parameter interactions or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Add multiple tags') and the target resource ('to a case'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'delete_case_tag' or 'get_case_tags' beyond the basic verb difference, missing an opportunity to clarify its specific role in the tagging workflow.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'update_case' (which might also handle tags) or 'delete_case_tag'. The description lacks context about prerequisites, such as whether the case must exist or be in a specific state, or any limitations compared to sibling operations.

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