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

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

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,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions what the tool does (analysis, identification) but lacks critical behavioral details: it doesn't specify whether this is a read-only analysis or if it might modify anything, what the output format looks like, whether it requires specific permissions, or any rate limits. For a tool with no annotation coverage, this leaves significant gaps in understanding its operational behavior.

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 appropriately concise with two sentences that each serve a clear purpose: the first states what the tool does, and the second provides usage context. There's no wasted language, and it's front-loaded with the core functionality. However, it could be slightly more structured by explicitly separating purpose from guidelines.

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

Completeness3/5

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

Given the tool's moderate complexity (architectural analysis with 3 parameters), no annotations, and no output schema, the description is minimally adequate but incomplete. It covers the basic purpose and usage context but lacks behavioral transparency and output information that would be crucial for effective use. The description doesn't compensate for the absence of structured metadata about the tool's behavior and results.

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 clear documentation for all three parameters. The tool description adds no parameter-specific information beyond what's already in the schema. According to the scoring rules, when schema_description_coverage is high (>80%), the baseline is 3 even with no param info in the description, which applies here.

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: 'Analyzes system architecture, identifying patterns, potential issues, and improvement opportunities.' It specifies the verb ('analyzes') and resource ('system architecture'), and distinguishes it from siblings by focusing on architectural analysis rather than code generation, debugging, or other tasks. However, it doesn't explicitly differentiate from similar-sounding siblings like 'compare_approaches' or 'estimate_complexity'.

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

Usage Guidelines3/5

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

The description provides implied usage guidance: 'Use for design reviews and technical decisions.' This suggests appropriate contexts but doesn't explicitly state when NOT to use it or name alternatives among the many sibling tools. For example, it doesn't clarify whether to use this vs. 'compare_approaches' for architectural comparisons or 'estimate_complexity' for complexity assessment.

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

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