Skip to main content
Glama
CodeHealth MCP Server

CodeHealth MCP Server

code_health_review

Review one source file to list code smells, spot refactoring targets, and check edits for new issues; fix highest-severity findings first.

Instructions

Review one source file and list its code smells.

When to use: to decide what to refactor, or to check that an edit did not
add smells. Fix the findings with the highest severity first.
Limitations: static analysis of a single file; duplication within the
file only (needs PMD). analyzers lists which analyzers ran and which
smells were unavailable for this language.
Returns: {score, category, findings:[{smell, level, function,
start_line, end_line (null for whole-file findings), value, threshold,
severity, message, hint, details}],
pmd_violations?, analyzers:{lizard, tree_sitter, pmd, unavailable_smells}}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "file_path": "<file_path>"
    },
    "name": "code_health_review"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_pathYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations present, the description carries the full load and does disclose real behavioral traits: it is static single-file analysis, duplication detection is intra-file only and depends on PMD, and the 'analyzers' block reports which analyzers ran and which smells were unavailable for the language. Not stated is that it is a read-only operation and whether analysis is expensive or rate-limited, but the language-coverage caveat is unusually informative.

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?

Labeled sections (When to use, Limitations, Returns) with the purpose stated first and zero filler sentences. Each line carries distinct information an agent needs.

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

Completeness4/5

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

Limitations, severity triage advice, and the analyzer-availability caveat cover what an agent needs before calling, and an output schema exists so the Returns block is somewhat redundant though it usefully explains field semantics like null end_line for whole-file findings. The one remaining hole is the file_path format, and nothing about side effects or runtime cost.

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?

There is one parameter (file_path) with 0% schema description coverage, so the schema contributes nothing. The description implies it takes a source file path but adds no detail on relative vs absolute paths, workspace root, or supported extensions, leaving a real gap for the single input an agent must supply.

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 opens with a specific verb and resource ('Review one source file and list its code smells') and constrains scope to a single file. It is clear what the tool does, but it never distinguishes itself from the sibling code_health_score or analyze_change_set, so an agent must infer the boundary.

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

Usage Guidelines4/5

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

An explicit 'When to use' clause gives two concrete triggers (deciding what to refactor, verifying an edit added no smells) plus a follow-up heuristic about severity ordering. There is no statement of when NOT to use it or which sibling to pick instead, so it stops short of full routing guidance.

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