Skip to main content
Glama
bswa006

AI Agent Template MCP Server

by bswa006

create_maintenance_workflows

Generate team workflows to maintain AI context quality over time by defining update schedules, checklists, metrics, and training for consistent project management.

Instructions

Create team workflows for maintaining AI context quality over time

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the project directory
analysisIdNoAnalysis ID from analyze_codebase_deeply
teamSizeYesNumber of developers on the team
updateFrequencyYesHow often the team updates context
includeChecklistsNoInclude review checklists
includeMetricsNoInclude metrics dashboard
includeTrainingNoInclude training materials

Implementation Reference

  • Main execution function that creates maintenance workflow files (handbook, checklists, procedures, onboarding guides, metrics dashboard, etc.) in the project's agent-context/workflows directory based on team size and update frequency.
    export async function createMaintenanceWorkflows(
      config: MaintenanceConfig
    ): Promise<MaintenanceResult> {
      const result: MaintenanceResult = {
        success: false,
        filesCreated: [],
        message: '',
        workflows: {
          regular: [],
          emergency: [],
          onboarding: [],
        },
      };
    
      try {
        // Check if analysis has been completed
        const analysisId = config.analysisId || global.latestAnalysisId;
        if (!analysisId || !global.codebaseAnalysis?.[analysisId]) {
          throw new Error('Codebase analysis must be completed first. Run analyze_codebase_deeply tool.');
        }
    
        const analysis: DeepAnalysisResult = global.codebaseAnalysis[analysisId];
        
        // Create workflows directory
        const workflowsDir = join(config.projectPath, 'agent-context', 'workflows');
        if (!existsSync(workflowsDir)) {
          mkdirSync(workflowsDir, { recursive: true });
        }
        
        // Create maintenance handbook
        const handbook = createMaintenanceHandbook(config, analysis);
        const handbookPath = join(workflowsDir, 'MAINTENANCE-HANDBOOK.md');
        writeFileSync(handbookPath, handbook);
        result.filesCreated.push(handbookPath);
        result.workflows.regular.push('Maintenance Handbook');
        
        // Create update workflow
        const updateWorkflow = createUpdateWorkflow(config, analysis);
        const updatePath = join(workflowsDir, 'context-update-workflow.md');
        writeFileSync(updatePath, updateWorkflow);
        result.filesCreated.push(updatePath);
        result.workflows.regular.push('Context Update Workflow');
        
        // Create review checklist if requested
        if (config.includeChecklists) {
          const reviewChecklist = createReviewChecklist(config, analysis);
          const checklistPath = join(workflowsDir, 'context-review-checklist.md');
          writeFileSync(checklistPath, reviewChecklist);
          result.filesCreated.push(checklistPath);
          result.workflows.regular.push('Review Checklist');
          
          // Create quality checklist
          const qualityChecklist = createQualityChecklist(analysis);
          const qualityPath = join(workflowsDir, 'quality-checklist.md');
          writeFileSync(qualityPath, qualityChecklist);
          result.filesCreated.push(qualityPath);
          result.workflows.regular.push('Quality Checklist');
        }
        
        // Create emergency procedures
        const emergencyProcedures = createEmergencyProcedures(config, analysis);
        const emergencyPath = join(workflowsDir, 'emergency-procedures.md');
        writeFileSync(emergencyPath, emergencyProcedures);
        result.filesCreated.push(emergencyPath);
        result.workflows.emergency.push('Emergency Procedures');
        
        // Create team onboarding guide
        const onboardingGuide = createOnboardingGuide(config, analysis);
        const onboardingPath = join(workflowsDir, 'team-onboarding.md');
        writeFileSync(onboardingPath, onboardingGuide);
        result.filesCreated.push(onboardingPath);
        result.workflows.onboarding.push('Team Onboarding');
        
        // Create metrics dashboard if requested
        if (config.includeMetrics) {
          const metricsDashboard = createMetricsDashboard(config, analysis);
          const metricsPath = join(workflowsDir, 'metrics-dashboard.md');
          writeFileSync(metricsPath, metricsDashboard);
          result.filesCreated.push(metricsPath);
          result.workflows.regular.push('Metrics Dashboard');
        }
        
        // Create training materials if requested
        if (config.includeTraining) {
          const trainingMaterials = createTrainingMaterials(config, analysis);
          const trainingPath = join(workflowsDir, 'ai-context-training.md');
          writeFileSync(trainingPath, trainingMaterials);
          result.filesCreated.push(trainingPath);
          result.workflows.onboarding.push('Training Materials');
        }
        
        // Create workflow index
        const workflowIndex = createWorkflowIndex(result.workflows, config);
        const indexPath = join(workflowsDir, 'README.md');
        writeFileSync(indexPath, workflowIndex);
        result.filesCreated.push(indexPath);
        
        result.success = true;
        result.message = `Created ${result.filesCreated.length} maintenance workflows for ${config.teamSize}-person team`;
      } catch (error) {
        result.success = false;
        result.message = `Failed to create maintenance workflows: ${error}`;
      }
    
      return result;
    }
  • JSON schema defining the input parameters and validation for the tool.
      name: 'create_maintenance_workflows',
      description: 'Create team workflows for maintaining AI context quality over time',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'Path to the project directory',
          },
          analysisId: {
            type: 'string',
            description: 'Analysis ID from analyze_codebase_deeply',
          },
          teamSize: {
            type: 'number',
            description: 'Number of developers on the team',
          },
          updateFrequency: {
            type: 'string',
            enum: ['daily', 'weekly', 'biweekly', 'monthly'],
            description: 'How often the team updates context',
          },
          includeChecklists: {
            type: 'boolean',
            description: 'Include review checklists',
          },
          includeMetrics: {
            type: 'boolean',
            description: 'Include metrics dashboard',
          },
          includeTraining: {
            type: 'boolean',
            description: 'Include training materials',
          },
        },
        required: ['projectPath', 'teamSize', 'updateFrequency'],
      },
    },
  • Tool dispatch/registration in the main switch statement that parses arguments and calls the handler function.
    case 'create_maintenance_workflows': {
      const params = z.object({
        projectPath: z.string(),
        analysisId: z.string().optional(),
        teamSize: z.number(),
        updateFrequency: z.enum(['daily', 'weekly', 'biweekly', 'monthly']),
        includeChecklists: z.boolean().optional(),
        includeMetrics: z.boolean().optional(),
        includeTraining: z.boolean().optional(),
      }).parse(args);
      
      const result = await createMaintenanceWorkflows(params);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Import statement registering the handler function for use in the tool router.
    import { createMaintenanceWorkflows } from './workspace/create-maintenance-workflows.js';
  • Supporting helper functions that generate content for individual workflow documents (handbook, checklists, emergency procedures, onboarding, metrics, training, index). Note: lines overlap with handler as they are in the same file.
    }
    
    function createMaintenanceHandbook(config: MaintenanceConfig, analysis: DeepAnalysisResult): string {
Behavior2/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 states 'create' which implies a write operation, but doesn't describe what gets created (e.g., files, configurations, documentation), whether it's idempotent, what permissions are needed, or what the output looks like. This leaves significant gaps for a tool with 7 parameters and no output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, with every part contributing to understanding the core function.

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 complexity (7 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain what the tool produces, how it interacts with sibling tools (e.g., 'analyze_codebase_deeply' for 'analysisId'), or behavioral aspects like side effects. For a creation tool with multiple parameters, more context is needed.

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 7 parameters. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain relationships between parameters like how 'analysisId' from 'analyze_codebase_deeply' informs the workflow). Baseline 3 is appropriate when schema does the heavy lifting.

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 action ('create') and resource ('team workflows for maintaining AI context quality over time'), providing a specific purpose. However, it doesn't explicitly differentiate from sibling tools like 'complete_setup_workflow' or 'setup_persistence_automation' that might also involve workflow creation, missing full sibling distinction.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an analysis from 'analyze_codebase_deeply' as implied by the 'analysisId' parameter), nor does it specify scenarios where this tool is appropriate over other workflow-related 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/bswa006/mcp-context-manager'

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