get_case_tags
Retrieve tags associated with a specific case in Pega to organize, categorize, and filter case data for better management and analysis.
Instructions
Get list of tags associated to a case
Input 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. | |
| 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
- src/tools/tags/get-case-tags.js:36-63 (handler)The execute method implements the core logic of the 'get_case_tags' tool. It validates the caseID parameter, initializes the session configuration, and executes pegaClient.getCaseTags with standardized error handling.
async execute(params) { const { caseID } = params; let sessionInfo = null; try { 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 Tags: ${caseID}`, async () => await this.pegaClient.getCaseTags(caseID.trim()), { sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Case Tags: ${caseID}\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*` }] }; } } - The static getDefinition method provides the tool name, description, and input schema definition for MCP protocol validation.
static getDefinition() { return { name: 'get_case_tags', description: 'Get list of tags associated 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.' }, sessionCredentials: getSessionCredentialsSchema() }, required: ['caseID'] } }; } - src/api/pega-client.js:899-904 (helper)The underlying Pega client method getCaseTags that retrieves tags for a given case ID, called directly by the tool handler.
async getCaseTags(caseID) { if (!this.isFeatureAvailable('tags')) { this.throwUnsupportedFeatureError('tags', 'getCaseTags'); } return this.client.getCaseTags(caseID); }