Skip to main content
Glama

Workload Analysis

Analyze team member workload to identify capacity issues and provide proactive recommendations for balanced task distribution.

Instructions

Comprehensive workload analysis with proactive insights and predictive recommendations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assigneeYesPerson to analyze (e.g., "John", "Jane")

Implementation Reference

  • The MCP tool handler function that executes the workload analysis logic by instantiating WorkloadAnalysisProcessor and returning structured JSON response.
    handler: async ({ assignee }: { assignee: string }) => {
      try {
        const processor = new WorkloadAnalysisProcessor(process.env.MCP_DEBUG_MODE === 'true');
        const analysis = await processor.analyzeWorkload(assignee);
    
        // SAFETY: Ensure analysis is valid
        if (!analysis) {
          throw new Error('Workload analysis returned null or undefined');
        }
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  assignee: analysis.assignee || assignee,
                  summary: `${analysis.assignee || assignee}: ${analysis.totalTasks || 0} tasks, ${analysis.workloadScore || 0}/100 score, ${analysis.efficiency || 0}% efficiency`,
                  workload_score: analysis.workloadScore || 0,
                  efficiency: analysis.efficiency || 0,
                  capacity_utilization: analysis.capacityUtilization || 0,
                  velocity_trend: analysis.velocityTrend || 'STABLE',
                  status_breakdown: analysis.statusBreakdown || {
                    TODO: 0,
                    IN_PROGRESS: 0,
                    COMPLETED: 0,
                    BLOCKED: 0,
                  },
                  overdue_tasks: analysis.overdueTasks || 0,
                  risk_factors: analysis.riskFactors || [],
                  insights: analysis.insights || [],
                  recommendations: analysis.recommendations || [],
                  prediction: analysis.prediction || null,
                  team_context: analysis.teamContext || null,
                  requires_attention:
                    (analysis.workloadScore || 0) > 80 || (analysis.riskFactors || []).length > 1,
                },
                null,
                2,
              ),
            },
          ],
        };
      } catch (error) {
        console.error(`[WorkloadAnalysis] Handler failed:`, error);
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(
                {
                  assignee,
                  success: false,
                  error: (error as Error).message,
                  summary: `Failed to analyze workload for ${assignee}`,
                  insights: ['Workload analysis unavailable'],
                  recommendations: ['Check system connectivity and try again'],
                },
                null,
                2,
              ),
            },
          ],
        };
      }
    },
  • Zod schema defining the input parameters for the 'Workload Analysis' tool (assignee string).
    parameters: z.object({
      assignee: z
        .string()
        .min(1, 'Assignee name is required')
        .max(100, 'Assignee name too long')
        .describe('Person name to analyze workload for (e.g., "John", "Jane")'),
  • Registration of the 'Workload Analysis' tool (workloadAnalysisTool) in the mcpTools array used by the MCP server.
    export const mcpTools = [naturalLanguageQueryTool, workloadAnalysisTool, riskAssessmentTool];
  • Core analyzeWorkload method in WorkloadAnalysisProcessor class that orchestrates the full workload analysis pipeline including caching, enhancement, prediction, and team context.
    async analyzeWorkload(assignee: string): Promise<EnhancedWorkloadAnalysis> {
      const startTime = Date.now();
    
      try {
        this.debug(`Analyzing workload for: ${assignee}`);
    
        // CACHE: Check for recent analysis
        const cacheKey = `workload:analysis:${assignee.toLowerCase()}`;
        let cachedAnalysis = await CacheService.get<EnhancedWorkloadAnalysis>(cacheKey);
    
        if (cachedAnalysis) {
          this.debug(`Retrieved cached analysis for ${assignee}`);
          return cachedAnalysis;
        }
    
        // Stage 1: Get base workload analysis
        const baseAnalysis = await this.apiClient.getWorkloadAnalysis(assignee);
    
        // Stage 2: Enhance with proactive insights
        const enhancedAnalysis = await this.enhanceWorkloadAnalysis(baseAnalysis);
    
        // Stage 3: Add predictive modeling
        enhancedAnalysis.prediction = await this.generateWorkloadPrediction(enhancedAnalysis);
    
        // Stage 4: Add team context
        enhancedAnalysis.teamContext = await this.generateTeamContext(enhancedAnalysis);
    
        // CACHE: Store enhanced analysis
        await CacheService.set(cacheKey, enhancedAnalysis, this.ANALYSIS_CACHE_TTL);
    
        const processingTime = Date.now() - startTime;
        this.debug(`Workload analysis completed for ${assignee} in ${processingTime}ms`);
    
        return enhancedAnalysis;
      } catch (error) {
        this.debug(`Workload analysis failed for ${assignee}: ${error}`);
        throw error;
      }
    }
  • Simplified input schema returned by MCP server for tool listing (ListToolsRequest).
    case 'Workload Analysis':
      return {
        type: 'object',
        properties: {
          assignee: {
            type: 'string',
            description: 'Person to analyze (e.g., "John", "Jane")',
            minLength: 1,
            maxLength: 100,
          },
        },
        required: ['assignee'],
      };
Behavior2/5

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

No annotations are provided, so the description carries full burden. While 'analysis' suggests a read operation, it doesn't clarify whether this tool makes changes, requires specific permissions, has rate limits, or what format results take. 'Proactive insights and predictive recommendations' hints at computational complexity but lacks concrete behavioral details needed for safe invocation.

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 a single, efficient sentence that gets straight to the point without unnecessary words. While it could be more informative, every word contributes to describing the tool's function. The structure is appropriately front-loaded with the core purpose.

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 tool with no annotations, no output schema, and sibling tools present, the description is insufficiently complete. It doesn't explain what 'workload' encompasses, what format results take, or how this differs from sibling tools. The agent lacks necessary context to use this tool effectively versus alternatives.

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% with only one parameter ('assignee') clearly documented in the schema. The description adds no additional parameter information beyond what the schema already provides. With high schema coverage and minimal parameters, the baseline score of 3 is appropriate - the description doesn't compensate but doesn't need to given the schema's completeness.

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

Purpose3/5

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

The description states the tool performs 'workload analysis' with 'insights and recommendations', which gives a general purpose but lacks specificity about what resources or data it analyzes. It doesn't clearly distinguish from sibling tools like 'Risk Assessment' or 'Natural Language Query' - all could potentially analyze workload data. The description is somewhat vague rather than tautological.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites, appropriate contexts, or exclusions. With sibling tools like 'Risk Assessment' and 'Natural Language Query' available, the agent receives no help in choosing between them for workload-related tasks.

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/jatinderbhola/mcp-taskflow-tracker-api'

If you have feedback or need assistance with the MCP directory API, please join our Discord server