Skip to main content
Glama

analyze_patterns

Analyze code for architectural, design, and implementation patterns. Detects pattern usage, inconsistencies, and provides actionable suggestions for improvement.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe source code to analyze
levelNoPattern level to analyze: 'architectural' (system structure), 'design' (GoF patterns), 'code' (implementation idioms), or 'all' (default)
queryNoOptional natural language query to focus analysis (e.g., 'how is error handling done?')
filenameYesThe filename (used to detect language)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of disclosing behavioral traits. It mentions the tool 'detects' and 'provides suggestions,' but does not state whether it is read-only, what side effects it has, performance implications, or failure modes. This leaves significant behavioral assumptions for a tool that analyzes arbitrary code.

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 exactly two sentences, front-loaded with the primary action ('Analyze code'), and contains no redundant or filler content. It efficiently communicates the purpose and expected output.

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 lack of annotations and output schema, the description is too sparse to be fully complete. It omits return value details, default behavior (e.g., level defaults to 'all'), and any guidance on usage context or limitations, especially when multiple sibling tools exist. The agent would need to infer or experiment to use this tool effectively.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds no additional meaning beyond the schema's parameter descriptions; the mention of 'patterns' reflects the level enum but does not elaborate on parameters like query or filename. The description's outcome statements are helpful but not parameter-specific.

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

Purpose5/5

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

The description clearly states the tool's function: 'Analyze code for architectural, design, and implementation patterns.' It specifies the resource (code), the action (analyze), and the scope (pattern levels), and distinguishes itself from siblings like analyze_code and analyze_design_patterns by covering all pattern levels and providing actionable suggestions.

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 explicit guidance on when to use this tool versus alternatives. It does not mention conditions for choosing analyze_patterns over analyze_code or analyze_design_patterns, nor does it offer exclusions or prerequisites. The context is implied but not stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

C2.4/5.0
Disambiguation2/5

Several tools have overlapping or ambiguous purposes that could confuse an agent. For example, analyze_code, analyze_patterns, and analyze_design_patterns all involve code analysis with unclear boundaries, while check_deceptive_patterns and check_placeholders seem like subsets of analyze_code. The NPM tools form a coherent group but are distinct from the rest, creating a fragmented toolset.

Naming Consistency2/5

Naming conventions are highly inconsistent across the toolset. Some tools use snake_case (e.g., analyze_code, execute_code), others use camelCase (e.g., npmAlternatives, npmChangelogAnalysis), and there are mixed styles like query-docs with hyphens. The NPM tools follow a consistent npmPrefix pattern internally, but this is not applied to other tools, leading to overall chaos.

Tool Count2/5

With 39 tools, this server is overloaded for a 'DevTools Collection' scope. The count feels excessive, as many tools could be consolidated (e.g., multiple analysis tools) or logically grouped. While the NPM tools are numerous but focused, the overall set lacks cohesion, making it cumbersome for an agent to navigate and select appropriate tools efficiently.

Completeness3/5

The toolset covers a broad range of development tasks, including code analysis, execution, documentation, and package management, but there are notable gaps. For example, there is no tool for code generation or refactoring, and the Microsoft and NPM tools are well-covered but isolated from other functionalities. The surface is extensive but not fully integrated, with some dead ends in workflow transitions.

Resources