Skip to main content
Glama

analyze_tech_stack

Analyzes GitHub repository technology stacks to generate targeted Learning Hour content for team skill development and technical practice sessions.

Instructions

Analyze a repository's technology stack to create team-specific Learning Hour content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repositoryUrlYesGitHub repository URL to analyze

Implementation Reference

  • Core handler function implementing the tech stack analysis logic by parsing repository config files, extracting languages, detecting frameworks, testing tools, build tools, and architectural patterns.
    async analyzeTechStack(repositoryUrl: string): Promise<TechStackProfile> {
      const { owner, repo } = this.parseGitHubUrl(repositoryUrl);
      
      try {
        const configFiles = await this.getConfigurationFiles(owner, repo);
        const repoInfo = await this.githubClient.getRepositoryInfo(owner, repo);
        
        const primaryLanguages = this.extractLanguages(repoInfo);
        const { frameworks, testingFrameworks, buildTools, dependencies } = 
          await this.analyzeConfigFiles(owner, repo, configFiles);
        const architecturalPatterns = await this.detectArchitecturalPatterns(owner, repo);
    
        // Always return something, even if we couldn't find specific details
        if (primaryLanguages.length === 0) {
          primaryLanguages.push('Unknown');
        }
    
        return {
          primaryLanguages,
          frameworks,
          testingFrameworks,
          buildTools,
          architecturalPatterns,
          packageDependencies: dependencies
        };
      } catch (error) {
        if (error instanceof Error && error.message.includes('GitHub MCP client not connected')) {
          throw new Error('GitHub integration not configured. Please ensure GITHUB_TOKEN is set in your environment.');
        }
        throw error;
      }
    }
  • src/index.ts:171-184 (registration)
    Tool registration in the MCP server's listTools response, defining name, description, and input schema.
    {
      name: "analyze_tech_stack",
      description: "Analyze a repository's technology stack to create team-specific Learning Hour content",
      inputSchema: {
        type: "object",
        properties: {
          repositoryUrl: {
            type: "string",
            description: "GitHub repository URL to analyze",
          },
        },
        required: ["repositoryUrl"],
      },
    },
  • Zod input schema for validating the repositoryUrl argument.
    const AnalyzeTechStackInputSchema = z.object({
      repositoryUrl: z.string().min(1, "Repository URL is required"),
    });
  • MCP server wrapper handler that validates input, calls TechStackAnalyzer, formats response, and handles errors.
    private async analyzeTechStack(args: any) {
      const input = AnalyzeTechStackInputSchema.parse(args);
    
      try {
        const techProfile = await this.techStackAnalyzer.analyzeTechStack(input.repositoryUrl);
    
        return {
          content: [
            {
              type: "text",
              text: `✅ Technology stack analysis completed for: ${input.repositoryUrl}`,
            },
            {
              type: "text",
              text: `Primary languages: ${techProfile.primaryLanguages.join(', ')}`,
            },
            {
              type: "text",
              text: `Frameworks: ${techProfile.frameworks.join(', ')}`,
            },
            {
              type: "text",
              text: JSON.stringify(techProfile, null, 2),
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
    
        if (errorMessage.includes('GitHub integration not configured')) {
          return {
            content: [
              {
                type: "text",
                text: `❌ GitHub integration not configured`,
              },
              {
                type: "text",
                text: `To use tech stack analysis, please set GITHUB_TOKEN in your environment.`,
              },
              {
                type: "text",
                text: `Visit https://github.com/settings/tokens to create a personal access token with 'repo' scope.`,
              },
            ],
          };
        }
    
        if (errorMessage.includes('Unable to analyze tech stack')) {
          return {
            content: [
              {
                type: "text",
                text: `⚠️ Unable to analyze repository`,
              },
              {
                type: "text",
                text: errorMessage,
              },
            ],
          };
        }
    
        throw new Error(`Failed to analyze tech stack: ${errorMessage}`);
      }
    }
  • TypeScript interface defining the structure of the tech stack analysis output.
    export interface TechStackProfile {
      primaryLanguages: string[];
      frameworks: string[];
      testingFrameworks: string[];
      buildTools: string[];
      architecturalPatterns: string[];
      packageDependencies: string[];
    }
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. It mentions the action ('analyze') and outcome ('create team-specific Learning Hour content'), but lacks details on permissions, rate limits, side effects, or what the analysis entails (e.g., does it modify data, require authentication, or have limitations?). This is inadequate for a tool with no annotation coverage.

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, well-structured sentence that efficiently conveys the tool's purpose without unnecessary words. It is front-loaded and every part earns its place, making it easy to parse quickly.

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 of analyzing a tech stack and creating content, the description is incomplete. There's no output schema, and with no annotations, it fails to explain behavioral aspects like what the analysis returns, how 'Learning Hour content' is generated, or any dependencies. This leaves significant gaps for an AI agent to understand the tool fully.

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?

The input schema has 100% description coverage, with 'repositoryUrl' documented as 'GitHub repository URL to analyze.' The description adds no additional parameter semantics beyond this, such as format examples or constraints. With high schema coverage, the baseline is 3, as the schema handles 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: 'Analyze a repository's technology stack to create team-specific Learning Hour content.' It specifies the verb ('analyze'), resource ('repository's technology stack'), and intended outcome ('create team-specific Learning Hour content'). However, it doesn't explicitly distinguish this from sibling tools like 'analyze_repository' or 'generate_session', which might have overlapping functionality.

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, exclusions, or compare it to sibling tools such as 'analyze_repository' or 'generate_session', which could be relevant for similar tasks. The agent must infer usage from the purpose alone.

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/SDiamante13/learning-hour-mcp'

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