Skip to main content
Glama
marco-looy

Pega DX MCP Server

by marco-looy

get_next_assignment

Retrieve the next work assignment for the current user, providing UI metadata for form or page views to facilitate task completion.

Instructions

Get detailed information about the next assignment to be performed by the requestor. Uses Get Next Work functionality to fetch the assignment most suitable for the current user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
viewTypeNoUI resources to return. "form" returns only assignment UI metadata in uiResources object, "page" returns full page (read-only review mode) UI metadata in uiResources objectpage
pageNameNoIf provided, view metadata for specific page name will be returned (only used when viewType is "page")
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 executing the tool logic: parameter handling, validation, session setup, API call to pegaClient.getNextAssignment, and error handling.
    async execute(params) { // Handle null/undefined params const safeParams = params || {}; const { viewType = 'page', pageName } = safeParams; let sessionInfo = null; try { // Initialize session configuration if provided sessionInfo = this.initializeSessionConfig(safeParams); // Validate enum parameters using base class const enumValidation = this.validateEnumParams(safeParams, { viewType: ['form', 'page'] }); if (enumValidation) { return enumValidation; } // Validate pageName usage if (pageName && viewType !== 'page') { return { error: 'pageName parameter can only be used when viewType is set to "page".' }; } // Execute with standardized error handling return await this.executeWithErrorHandling( 'Next Assignment', async () => await this.pegaClient.getNextAssignment({ viewType, pageName }), { viewType, pageName, sessionInfo } ); } catch (error) { return { content: [{ type: 'text', text: `## Error: Next Assignment\n\n**Unexpected Error**: ${error.message}\n\n${sessionInfo ? `**Session**: ${sessionInfo.sessionId} (${sessionInfo.authMode} mode)\n` : ''}*Error occurred at: ${new Date().toISOString()}*` }] }; } }
  • Tool definition for MCP including name, description, and input schema with parameters viewType, pageName, sessionCredentials.
    static getDefinition() { return { name: 'get_next_assignment', description: 'Get detailed information about the next assignment to be performed by the requestor. Uses Get Next Work functionality to fetch the assignment most suitable for the current user.', inputSchema: { type: 'object', properties: { viewType: { type: 'string', enum: ['form', 'page'], description: 'UI resources to return. "form" returns only assignment UI metadata in uiResources object, "page" returns full page (read-only review mode) UI metadata in uiResources object', default: 'page' }, pageName: { type: 'string', description: 'If provided, view metadata for specific page name will be returned (only used when viewType is "page")' }, sessionCredentials: getSessionCredentialsSchema() }, required: [] } }; }
  • Static method declaring the tool category as 'assignments' for loader grouping.
    static getCategory() { return 'assignments'; }
  • PegaClient wrapper delegating getNextAssignment to the version-specific (v1/v2) client implementation.
    async getNextAssignment(options = {}) { return this.client.getNextAssignment(options); }
  • ToolRegistry initialization where configurableToolLoader.discoverTools() automatically discovers and registers all tools including get_next_assignment by scanning src/tools directories.
    const categories = await this.loader.discoverTools(); this.categories = categories; this.tools = this.loader.getLoadedTools(); const stats = this.loader.getStats(); console.error(`✅ Tool discovery complete:`); console.error(` - ${stats.totalTools} tools loaded`);

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