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`);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the 'Get Next Work functionality' but doesn't describe what happens when no assignments are available, whether this affects workflow state, authentication requirements beyond the sessionCredentials parameter, or response format. For a tool that likely interacts with workflow systems, this leaves significant behavioral gaps.

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 concise with two sentences that directly address purpose and mechanism. It's front-loaded with the core functionality. However, the second sentence could be more tightly integrated with the first for slightly better flow.

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?

Given the tool's complexity (workflow assignment retrieval with authentication options), no annotations, no output schema, and multiple parameters, the description is insufficient. It doesn't explain what 'detailed information' includes, how assignments are prioritized as 'most suitable', or what the response structure looks like. The agent would struggle to use this effectively without trial and error.

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 3 parameters. The description adds no parameter-specific information beyond what's in the schema. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 tool's purpose: 'Get detailed information about the next assignment to be performed by the requestor' with the specific mechanism 'Uses Get Next Work functionality'. It distinguishes from sibling tools like 'get_assignment' by focusing on 'next' assignment retrieval. However, it doesn't explicitly contrast with 'navigate_assignment_previous' or other assignment-related tools, preventing a perfect score.

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 ('most suitable for the current user') but doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_assignment' or 'navigate_assignment_previous'. No exclusions or prerequisites are mentioned, leaving the agent to infer appropriate usage scenarios.

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