Skip to main content
Glama
bswa006

AI Agent Template MCP Server

by bswa006

complete_setup_workflow

Analyze codebase, create context files, and configure automation for AI agent projects to enhance coding capabilities.

Instructions

Complete MCP setup workflow: analyze codebase, create all context files, and configure automation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYesPath to the project directory
projectNameYesName of the project
teamSizeNoNumber of developers on the team
updateScheduleNoHow often to update context files
ideNoWhich IDE configurations to create
includeAllNoInclude all optional features

Implementation Reference

  • Main handler function that orchestrates the entire setup workflow by sequentially calling analysis, initialization, conversation starters, token optimization, IDE configs, persistence automation, and maintenance workflows.
    export async function completeSetupWorkflow(config: SetupConfig): Promise<SetupResult> {
      const result: SetupResult = {
        success: false,
        message: '',
        steps: {},
        filesCreated: [],
        recommendations: [],
      };
    
      try {
        console.log('šŸš€ Starting Complete Setup Workflow...');
        
        // Step 1: Deep Analysis
        console.log('\nšŸ“Š Step 1/7: Analyzing codebase deeply...');
        const analysisResult = await analyzeCodebaseDeeply({ projectPath: config.projectPath });
        result.steps.analysis = {
          success: analysisResult.success,
          analysisId: analysisResult.analysisId,
          message: analysisResult.success 
            ? `Analyzed ${analysisResult.summary.totalFiles} files` 
            : 'Analysis failed',
        };
        
        if (!analysisResult.success || !analysisResult.analysisId) {
          throw new Error('Deep analysis failed. Cannot proceed with setup.');
        }
        
        const analysisId = analysisResult.analysisId;
        
        // Step 2: Initialize Workspace
        console.log('\nšŸŽÆ Step 2/7: Initializing agent workspace...');
        const initResult = await initializeAgentWorkspace({
          projectPath: config.projectPath,
          projectName: config.projectName,
          techStack: {
            language: analysisResult.summary.primaryLanguage,
            framework: analysisResult.summary.frameworks[0],
            uiLibrary: analysisResult.summary.frameworks.find(f => 
              ['React', 'Vue', 'Angular', 'Svelte'].includes(f)
            ),
            testFramework: analysisResult.summary.testingFrameworks[0],
          },
        });
        result.steps.initialization = {
          success: initResult.success,
          message: initResult.message,
        };
        result.filesCreated.push(...initResult.filesCreated);
        
        // Step 3: Create Conversation Starters
        console.log('\nšŸ’¬ Step 3/7: Creating conversation starters...');
        const conversationResult = await createConversationStarters({
          projectPath: config.projectPath,
          analysisId,
          includeQuickTasks: true,
          includeCurrentWork: true,
        });
        result.steps.conversationStarters = {
          success: conversationResult.success,
          message: conversationResult.message,
        };
        result.filesCreated.push(...conversationResult.filesCreated);
        
        // Step 4: Create Token Optimizer
        console.log('\nšŸ’Ž Step 4/7: Creating token optimization tiers...');
        const tokenResult = await createTokenOptimizer({
          projectPath: config.projectPath,
          analysisId,
          tiers: ['minimal', 'standard', 'comprehensive'],
          trackUsage: true,
          generateMetrics: true,
        });
        result.steps.tokenOptimizer = {
          success: tokenResult.success,
          message: tokenResult.message,
        };
        result.filesCreated.push(...tokenResult.filesCreated);
        
        // Step 5: Create IDE Configurations
        console.log('\nšŸ› ļø Step 5/7: Creating IDE configurations...');
        const ideResult = await createIDEConfigs({
          projectPath: config.projectPath,
          analysisId,
          ide: config.ide || 'all',
          autoLoadContext: true,
          includeDebugConfigs: true,
        });
        result.steps.ideConfigs = {
          success: ideResult.success,
          message: ideResult.message,
        };
        result.filesCreated.push(...ideResult.filesCreated);
        
        // Step 6: Setup Persistence Automation
        console.log('\nšŸ”„ Step 6/7: Setting up persistence automation...');
        const persistenceResult = await setupPersistenceAutomation({
          projectPath: config.projectPath,
          analysisId,
          updateSchedule: config.updateSchedule || 'weekly',
          gitHooks: true,
          monitoring: true,
        });
        result.steps.persistence = {
          success: persistenceResult.success,
          message: persistenceResult.message,
        };
        result.filesCreated.push(...persistenceResult.filesCreated);
        
        // Step 7: Create Maintenance Workflows
        console.log('\nšŸ“‹ Step 7/7: Creating maintenance workflows...');
        const maintenanceResult = await createMaintenanceWorkflows({
          projectPath: config.projectPath,
          analysisId,
          teamSize: config.teamSize || 1,
          updateFrequency: config.updateSchedule === 'daily' ? 'daily' : 'weekly',
          includeChecklists: true,
          includeMetrics: true,
          includeTraining: !!(config.teamSize && config.teamSize > 1),
        });
        result.steps.maintenance = {
          success: maintenanceResult.success,
          message: maintenanceResult.message,
        };
        result.filesCreated.push(...maintenanceResult.filesCreated);
        
        // Generate recommendations
        result.recommendations = generateSetupRecommendations(
          analysisResult,
          config,
          result.steps
        );
        
        // Final summary
        const successfulSteps = Object.values(result.steps).filter(s => s.success).length;
        result.success = successfulSteps === 7;
        result.message = result.success
          ? `āœ… Complete setup successful! Created ${result.filesCreated.length} files.`
          : `āš ļø Setup completed with issues. ${successfulSteps}/7 steps successful.`;
        
        // Print summary
        console.log('\n' + '='.repeat(60));
        console.log('šŸ“Š SETUP SUMMARY');
        console.log('='.repeat(60));
        console.log(`Status: ${result.success ? 'āœ… SUCCESS' : 'āš ļø PARTIAL SUCCESS'}`);
        console.log(`Files Created: ${result.filesCreated.length}`);
        console.log('\nSteps:');
        Object.entries(result.steps).forEach(([step, status]) => {
          console.log(`  ${status.success ? 'āœ…' : 'āŒ'} ${step}: ${status.message}`);
        });
        
        if (result.recommendations.length > 0) {
          console.log('\nšŸ“Œ Recommendations:');
          result.recommendations.forEach((rec, i) => {
            console.log(`  ${i + 1}. ${rec}`);
          });
        }
        
        console.log('\nšŸŽ‰ Setup workflow complete!');
        
      } catch (error) {
        result.success = false;
        result.message = `Setup failed: ${error}`;
        console.error('\nāŒ Setup failed:', error);
      }
      
      return result;
    }
  • Tool schema definition including name, description, and inputSchema for validation.
    {
      name: 'complete_setup_workflow',
      description: 'Complete MCP setup workflow: analyze codebase, create all context files, and configure automation',
      inputSchema: {
        type: 'object',
        properties: {
          projectPath: {
            type: 'string',
            description: 'Path to the project directory',
          },
          projectName: {
            type: 'string',
            description: 'Name of the project',
          },
          teamSize: {
            type: 'number',
            description: 'Number of developers on the team',
          },
          updateSchedule: {
            type: 'string',
            enum: ['daily', 'weekly', 'on-change', 'manual'],
            description: 'How often to update context files',
          },
          ide: {
            type: 'string',
            enum: ['cursor', 'vscode', 'intellij', 'all'],
            description: 'Which IDE configurations to create',
          },
          includeAll: {
            type: 'boolean',
            description: 'Include all optional features',
          },
        },
        required: ['projectPath', 'projectName'],
      },
    },
  • Registration and dispatch handler in the main tool switch statement, with Zod input validation and call to the handler function.
    case 'complete_setup_workflow': {
      const params = z.object({
        projectPath: z.string(),
        projectName: z.string(),
        teamSize: z.number().optional(),
        updateSchedule: z.enum(['daily', 'weekly', 'on-change', 'manual']).optional(),
        ide: z.enum(['cursor', 'vscode', 'intellij', 'all']).optional(),
        includeAll: z.boolean().optional(),
      }).parse(args);
      
      const result = await completeSetupWorkflow(params);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • TypeScript interfaces defining input (SetupConfig) and output (SetupResult) types for the handler.
    interface SetupConfig {
      projectPath: string;
      projectName: string;
      teamSize?: number;
      updateSchedule?: 'daily' | 'weekly' | 'on-change' | 'manual';
      ide?: 'cursor' | 'vscode' | 'intellij' | 'all';
      includeAll?: boolean;
    }
    
    interface SetupResult {
      success: boolean;
      message: string;
      steps: {
        analysis?: { success: boolean; analysisId?: string; message: string };
        initialization?: { success: boolean; message: string };
        conversationStarters?: { success: boolean; message: string };
        tokenOptimizer?: { success: boolean; message: string };
        ideConfigs?: { success: boolean; message: string };
        persistence?: { success: boolean; message: string };
        maintenance?: { success: boolean; message: string };
      };
      filesCreated: string[];
      recommendations: string[];
    }
  • Import statement registering the handler function for use in the tool dispatcher.
    import { completeSetupWorkflow } from './workspace/complete-setup-workflow.js';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the three main actions, it doesn't describe what 'complete' entails (e.g., whether it's idempotent, what permissions are required, whether it modifies existing files, or what happens on failure). For a multi-step setup tool with no annotation coverage, this is a significant gap.

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 front-loads the main purpose. Every word contributes to understanding the tool's scope, though it could potentially be more structured for a multi-step workflow.

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 complex 6-parameter setup tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'complete' means operationally, what the expected outcomes are, or how this comprehensive tool relates to the many specialized sibling tools. The agent would lack crucial context for proper invocation.

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 already documents all six parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., how parameters interact or affect the workflow). The baseline of 3 is appropriate when the 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 tool's purpose with specific verbs ('analyze codebase', 'create all context files', 'configure automation') and identifies the resource ('MCP setup workflow'). However, it doesn't explicitly differentiate from sibling tools like 'analyze_codebase_deeply' or 'create_ide_configs', which appear to handle subsets of this comprehensive workflow.

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. With multiple sibling tools that seem to handle specific aspects (e.g., 'analyze_codebase_deeply', 'create_ide_configs'), there's no indication of whether this is a comprehensive one-time setup or when to choose it over more targeted tools.

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