Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_attachment_categories

Retrieve available attachment categories for a Pega case, filtered by type (File or URL), with user permission details for each category.

Instructions

Retrieve the list of attachment categories available for a specific Pega case, filtered by attachment type (File or URL). Returns category metadata including user permissions (view, create, edit, delete) for each attachment category associated with the case type. The API uses the class name from the caseID to get attachment categories and filters them based on the type parameter. Only attachment categories configured in the Attachment Category rule are returned. Useful for understanding what attachment categories are available and what operations the current user can perform on each category.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
caseIDYesCase ID. Example: "MYORG-APP-WORK C-1001". Complete identifier including spaces."OSIEO3-DOCSAPP-WORK T-561003". The API uses the class name from this caseID to determine which attachment categories are associated with the case type.
typeNoFilter for the attachment type to retrieve categories for. Case insensitive. "File" or "file" returns all attachment categories of type File. "URL" or "url" returns attachment categories of type URL. Default value is "File". The API returns attachment categories of either type File or type URL during a particular API call, not both simultaneously.File
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

  • Main handler function that executes the tool logic: validates inputs, normalizes parameters, calls Pega API via pegaClient.getCaseAttachmentCategories, and handles errors.
    async execute(params) {
      const { caseID, type = 'File' } = params;
    
      let sessionInfo = null;
      try {
        sessionInfo = this.initializeSessionConfig(params);
    
        // Basic parameter validation using base class
        const requiredValidation = this.validateRequiredParams(params, ['caseID']);
        if (requiredValidation) {
          return requiredValidation;
        }
    
        // Additional comprehensive parameter validation for complex logic
        const validationResult = this.validateParameters(caseID, type);
        if (!validationResult.valid) {
          return {
            error: validationResult.error
          };
        }
    
        // Normalize type parameter to handle case insensitivity
        const normalizedType = type.toLowerCase() === 'file' ? 'File' : 'URL';
    
        // Execute with standardized error handling
        return await this.executeWithErrorHandling(
          `Attachment Categories: ${caseID} (${normalizedType})`,
          async () => await this.pegaClient.getCaseAttachmentCategories(caseID, { type: normalizedType }),
          { caseID, type: normalizedType, sessionInfo }
        );
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `## Error: Attachment Categories\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*`
          }]
        };
      }
    }
  • Tool definition including name, description, and input schema for validation in MCP protocol.
    static getDefinition() {
      return {
        name: 'get_attachment_categories',
        description: 'Retrieve the list of attachment categories available for a specific Pega case, filtered by attachment type (File or URL). Returns category metadata including user permissions (view, create, edit, delete) for each attachment category associated with the case type. The API uses the class name from the caseID to get attachment categories and filters them based on the type parameter. Only attachment categories configured in the Attachment Category rule are returned. Useful for understanding what attachment categories are available and what operations the current user can perform on each category.',
        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". The API uses the class name from this caseID to determine which attachment categories are associated with the case type.'
            },
            type: {
              type: 'string',
              enum: ['File', 'URL', 'file', 'url'],
              description: 'Filter for the attachment type to retrieve categories for. Case insensitive. "File" or "file" returns all attachment categories of type File. "URL" or "url" returns attachment categories of type URL. Default value is "File". The API returns attachment categories of either type File or type URL during a particular API call, not both simultaneously.',
              default: 'File'
            },
            sessionCredentials: getSessionCredentialsSchema()
          },
          required: ['caseID']
        }
      };
    }
  • Dynamic registration via ToolLoader which scans tools directories, imports JS files, detects tool classes, validates, instantiates, and registers by name from getDefinition().
    export const toolLoader = new ToolLoader();
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: it's a read operation (implied by 'Retrieve'), returns filtered results based on type, includes permission metadata, uses the caseID's class name for lookup, and only returns configured categories. It does not cover rate limits, error conditions, or pagination, but provides substantial operational context.

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 well-structured and front-loaded with the core purpose. Most sentences add value, such as explaining filtering, return metadata, and configuration constraints. It could be slightly more concise by combining some explanatory clauses, but overall it avoids redundancy and waste.

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

Completeness4/5

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

Given the complexity (3 parameters, nested object, no output schema, no annotations), the description does a good job of covering the tool's purpose, behavior, and usage. It explains what is returned (category metadata with permissions) and operational constraints. Without an output schema, it could benefit from more detail on the return structure, but it provides enough context for 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 already documents all parameters thoroughly. The description adds some value by explaining that the API uses the class name from caseID and filters by type, but does not provide additional syntax or format details beyond what the schema offers. This meets the baseline for high schema coverage.

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 ('Retrieve the list'), resource ('attachment categories available for a specific Pega case'), and scope ('filtered by attachment type'). It distinguishes from sibling tools like 'get_attachment' or 'get_case_attachments' by focusing on categories rather than attachments themselves, and mentions the unique return of category metadata with user permissions.

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool: to understand available attachment categories and user permissions for a specific case, filtered by type. It mentions that only categories configured in the Attachment Category rule are returned, which sets expectations. However, it does not explicitly state when not to use it or name specific alternatives among siblings.

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