Skip to main content
Glama

analyze_architecture

Analyzes system architecture to identify patterns, detect potential issues, and suggest improvements for design reviews and technical decisions.

Instructions

Analyzes system architecture, identifying patterns, potential issues, and improvement opportunities. Use for design reviews and technical decisions.

Input Schema

NameRequiredDescriptionDefault
descriptionYesDescription of the architecture/system
componentsNoList of main components
concernsNoSpecific concerns to address

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "components": { "description": "List of main components", "items": { "type": "string" }, "type": "array" }, "concerns": { "description": "Specific concerns to address", "items": { "type": "string" }, "type": "array" }, "description": { "description": "Description of the architecture/system", "type": "string" } }, "required": [ "description" ], "type": "object" }

Implementation Reference

  • The main execution handler for the 'analyze_architecture' tool. It destructures input arguments and generates a comprehensive markdown report analyzing system architecture, including sections on components, concerns, patterns check (separation of concerns, scalability, resilience, security), and prioritized recommendations.
    export function analyzeArchitectureHandler(args: any) { const { description, components = [], concerns = [] } = args; const analysis = `# Architecture Analysis ## System Description ${description} ## Components Identified ${components.length > 0 ? components.map((c: string) => `- ${c}`).join("\n") : "No specific components listed"} ## Specific Concerns ${concerns.length > 0 ? concerns.map((c: string) => `- ${c}`).join("\n") : "No specific concerns raised"} --- ## Architecture Patterns Check ### Separation of Concerns - [ ] Clear boundaries between layers? - [ ] Business logic isolated from I/O? - [ ] UI separated from data access? ### Scalability - [ ] Can components scale independently? - [ ] Are there bottlenecks identified? - [ ] Is state management distributed? ### Resilience - [ ] Failure handling in place? - [ ] Circuit breakers where needed? - [ ] Graceful degradation possible? ### Security - [ ] Authentication/Authorization clear? - [ ] Data encryption at rest/transit? - [ ] API security measures? ## Recommendations ### High Priority 1. Ensure clear component boundaries 2. Implement proper error handling 3. Add comprehensive logging ### Medium Priority 1. Consider caching layer 2. Implement health checks 3. Add monitoring/alerting ### Low Priority 1. Document architecture decisions (ADRs) 2. Create dependency diagrams 3. Plan for future scaling ## Trade-offs to Consider - Complexity vs Flexibility - Performance vs Maintainability - Speed of delivery vs Technical debt `; return { content: [{ type: "text", text: analysis }] }; }
  • The Zod-based input schema definition for the 'analyze_architecture' tool, specifying the expected inputs: description (required string), components and concerns (optional string arrays).
    export const analyzeArchitectureSchema = { name: "analyze_architecture", description: "Analyzes system architecture, identifying patterns, potential issues, and improvement opportunities. Use for design reviews and technical decisions.", inputSchema: z.object({ description: z.string().describe("Description of the architecture/system"), components: z.array(z.string()).optional().describe("List of main components"), concerns: z.array(z.string()).optional().describe("Specific concerns to address") }) };
  • src/index.ts:81-81 (registration)
    Registration of the 'analyze_architecture' tool in the central toolRegistry Map used by the stdio MCP server, mapping the tool name to its schema and handler.
    ["analyze_architecture", { schema: analyzeArchitectureSchema, handler: analyzeArchitectureHandler }],
  • src/server.ts:91-91 (registration)
    Registration of the 'analyze_architecture' tool in the toolRegistry for the HTTP MCP server variant.
    ["analyze_architecture", { schema: analyzeArchitectureSchema, handler: analyzeArchitectureHandler }],
  • src/index.ts:36-36 (registration)
    Import statement bringing in the schema and handler for 'analyze_architecture' from src/tools/cognitive.ts into the main index.ts entrypoint.
    analyzeArchitectureSchema, analyzeArchitectureHandler,

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/millsydotdev/Code-MCP'

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