Skip to main content
Glama

analyze_codebase_health

Runs five analysis passes to detect code clones, dead symbols, god files, architecture violations, and naming issues. Returns a health score (0-100) and top recommendation.

Instructions

Analyze the health of the ingested codebase.

Runs 5 analysis passes over all fragments in the current session:

  1. Clone Detection — SimHash pairwise scan for Type-1/2/3 code clones

  2. Dead Symbol Analysis — defined but never referenced symbols

  3. God File Detection — files with > μ+2σ reverse dependencies

  4. Architecture Violation Detection — cross-layer imports

  5. Naming Convention Analysis — Python/Rust/React convention breaks

Returns a JSON HealthReport with: - code_health_score [0–100] and health_grade (A/B/C/D/F) - Per-dimension scores: duplication, dead_code, coupling, arch, naming - clone_pairs, dead_symbols, god_files, arch_violations, naming_issues - summary (human-readable) and top_recommendation (most impactful action)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries full burden and discloses that the tool runs 5 named passes over all fragments and returns a detailed HealthReport. However, it does not explicitly state whether the tool is read-only or has side effects, which is a minor gap. The analysis passes and return structure are well-described.

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 fairly long but well-organized with a numbered list of passes and a clear listing of return fields. Every sentence adds value, though it could be slightly more concise. The structure aids readability.

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

Completeness5/5

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

Given the tool has zero parameters and an output schema exists (implied by context and described in the description), the description is complete. It covers all necessary information: what the tool does, how it works (5 passes), and what it returns (HealthReport fields).

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

Parameters4/5

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

The tool has zero parameters, so the input schema is fully covered. The description does not need to add parameter details, and it does not. Baseline 4 applies.

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 analyzes codebase health, listing five specific analysis passes. It distinctly identifies the resource (codebase fragments in current session) and the action (health analysis). Among the sibling tools, none perform this exact function, so it is well-differentiated.

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 explains what the tool does (runs 5 analysis passes) but does not provide explicit guidance on when to use it versus alternatives like scan_for_vulnerabilities or security_scan. There are no use-case exclusions or references to other tools, leaving the agent to infer appropriate usage context.

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/juyterman1000/entroly'

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