Skip to main content
Glama
0xjcf
by 0xjcf

socio-technical-analysis

Analyze repository collaboration patterns and team dynamics to identify socio-technical relationships in code development workflows.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repositoryUrlYes
includeContributorPatternsNo
includeTeamDynamicsNo
timeRangeNo
visualizationFormatNojson

Implementation Reference

  • Registers the socio-technical-analysis MCP tool including Zod input schema validation and thin wrapper handler that delegates to the core analyzer function.
    export function registerSocioTechnicalFeatures(server: McpServer) {
      // Tool to analyze socio-technical patterns in repositories
      server.tool(
        "socio-technical-analysis",
        {
          repositoryUrl: z.string(),
          includeContributorPatterns: z.boolean().default(true),
          includeTeamDynamics: z.boolean().default(true),
          timeRange: z.object({
            start: z.string().optional(),
            end: z.string().optional()
          }).optional(),
          visualizationFormat: z.enum(["json", "mermaid", "dot"]).default("json")
        },
        async ({ repositoryUrl, includeContributorPatterns, includeTeamDynamics, timeRange, visualizationFormat }) => {
          try {
            const results = await analyzeSocioTechnicalPatterns(
              repositoryUrl, 
              includeContributorPatterns,
              includeTeamDynamics,
              timeRange,
              visualizationFormat
            );
            
            // Return appropriate content type based on visualization format
            if (visualizationFormat === "mermaid") {
              return {
                content: [{
                  type: "text",
                  text: results.visualization,
                  _metadata: { format: "mermaid" }
                }, {
                  type: "text",
                  text: JSON.stringify(results.analysis, null, 2)
                }]
              };
            } else if (visualizationFormat === "dot") {
              return {
                content: [{
                  type: "text",
                  text: results.visualization,
                  _metadata: { format: "dot" }
                }, {
                  type: "text",
                  text: JSON.stringify(results.analysis, null, 2)
                }]
              };
            } else {
              return {
                content: [{
                  type: "text",
                  text: JSON.stringify(results, null, 2)
                }]
              };
            }
          } catch (error) {
            return {
              content: [{
                type: "text",
                text: `Error in socio-technical analysis: ${(error as Error).message}`
              }],
              isError: true
            };
          }
        }
      );
    } 
  • Core handler function executing the full socio-technical analysis: git analysis for contributors, code ownership, team dynamics, knowledge graph integration, graph generation, visualization (Mermaid/DOT), and actionable insights.
    export async function analyzeSocioTechnicalPatterns(
      repositoryUrl: string,
      includeContributorPatterns: boolean = true,
      includeTeamDynamics: boolean = true,
      timeRange?: { start?: string, end?: string },
      visualizationFormat: "json" | "mermaid" | "dot" = "json"
    ): Promise<any> {
      console.log(`Analyzing socio-technical patterns for ${repositoryUrl}`);
      
      // Step 1: Clone/update the repository
      const repoPath = await getRepository(repositoryUrl);
      
      // Step 2: Analyze git history and contributors
      const contributorData = await analyzeContributors(repoPath, timeRange);
      
      // Step 3: Analyze code ownership and ownership patterns
      const ownershipData = includeContributorPatterns 
        ? await analyzeCodeOwnership(repoPath, contributorData)
        : null;
      
      // Step 4: Analyze team dynamics and collaboration patterns
      const teamDynamicsData = includeTeamDynamics 
        ? await analyzeTeamDynamics(repoPath, contributorData)
        : null;
      
      // Step 5: Build knowledge graph for technical dependencies
      console.log(`Building knowledge graph for technical dependencies...`);
      await buildKnowledgeGraph(repositoryUrl, 2, false);
      
      // Step 5b: Query knowledge graph to get actual nodes and relationships
      const graphData = await queryKnowledgeGraph({
        query: "",
        repositoryUrl,
        contextDepth: 2
      });
      
      // Step 6: Create socio-technical graph
      const socioTechnicalGraph = combineDataIntoGraph(
        contributorData, 
        ownershipData, 
        teamDynamicsData,
        graphData.nodes,
        graphData.relationships
      );
      
      // Step 7: Generate visualization
      let visualization = "";
      if (visualizationFormat === "mermaid") {
        visualization = generateMermaidDiagram(socioTechnicalGraph);
      } else if (visualizationFormat === "dot") {
        visualization = generateDotGraph(socioTechnicalGraph);
      }
      
      // Step 8: Generate insights
      const insights = generateInsights(
        contributorData, 
        ownershipData, 
        teamDynamicsData, 
        graphData.nodes, 
        graphData.relationships
      );
      
      // Return the analysis results
      return {
        repository: {
          url: repositoryUrl,
          path: repoPath
        },
        analysis: {
          contributors: summarizeContributors(contributorData),
          codeOwnership: ownershipData ? summarizeOwnership(ownershipData) : null,
          teamDynamics: teamDynamicsData ? summarizeTeamDynamics(teamDynamicsData) : null,
          insights
        },
        visualization,
        visualizationFormat
      };
    }
  • Zod schema defining input parameters for the socio-technical-analysis tool.
    {
      repositoryUrl: z.string(),
      includeContributorPatterns: z.boolean().default(true),
      includeTeamDynamics: z.boolean().default(true),
      timeRange: z.object({
        start: z.string().optional(),
        end: z.string().optional()
      }).optional(),
      visualizationFormat: z.enum(["json", "mermaid", "dot"]).default("json")
    },
  • src/server.ts:72-74 (registration)
    Top-level server initialization calls the feature registration function to add the socio-technical-analysis tool.
    console.log("• Registering socio-technical features...");
    registerToolsOnce(registerSocioTechnicalFeatures);
    console.log("✓");
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

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/0xjcf/MCP_CodeAnalysis'

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