Skip to main content
Glama

analyze_code_architecture

Analyze source code architecture to evaluate design patterns, SOLID principles, scalability, and security while providing improvement recommendations for better system design.

Instructions

Analyze code from an architectural perspective using GLM-4.6. Evaluates design patterns, SOLID principles, scalability, security implications, and provides improvement recommendations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe source code to analyze
languageYesProgramming language of the code (e.g., typescript, python, go, java)
questionYesSpecific architectural question about the code

Implementation Reference

  • MCP tool handler for 'analyze_code_architecture' that extracts input arguments (code, language, question) and delegates execution to GLMClient.analyzeCodeArchitecture method.
    case 'analyze_code_architecture': { const { code, language, question } = args as { code: string; language: string; question: string; }; const response = await glmClient.analyzeCodeArchitecture(code, language, question); return { content: [ { type: 'text', text: response, }, ], }; }
  • src/index.ts:43-64 (registration)
    Tool registration entry in the MCP tools array, defining name, description, and input schema for validation.
    { name: 'analyze_code_architecture', description: 'Analyze code from an architectural perspective using GLM-4.6. Evaluates design patterns, SOLID principles, scalability, security implications, and provides improvement recommendations.', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'The source code to analyze', }, language: { type: 'string', description: 'Programming language of the code (e.g., typescript, python, go, java)', }, question: { type: 'string', description: 'Specific architectural question about the code', }, }, required: ['code', 'language', 'question'], }, },
  • Helper method implementing the core logic: constructs a specific prompt with code snippet and question, then calls consultArchitecture to invoke GLM-4.6 API for analysis.
    async analyzeCodeArchitecture(code: string, language: string, question: string): Promise<string> { const query = `Analyze the following ${language} code from an architectural perspective: \`\`\`${language} ${code} \`\`\` Architectural Question: ${question} Provide analysis covering: 1. Architectural patterns used 2. Design principles adherence (SOLID, DRY, KISS) 3. Scalability considerations 4. Security implications 5. Recommended improvements`; return this.consultArchitecture(query); }

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/bobvasic/glm-mcp-server'

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