Skip to main content
Glama
nagavitalp

code-health-mcp

by nagavitalp

predict_refactor_risk

Analyze repository trends and metrics to predict which files require refactoring, using a configurable risk threshold.

Instructions

Predict which files are at risk of needing refactoring based on trends and metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
riskThresholdNoMinimum risk score to include in results (0-100)
repositoryPathYesPath to the repository root directory

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the behavioral disclosure burden. It only states that the tool predicts risk; it does not say whether it is read-only, what data or history is required, whether it is expensive to run, or what form the prediction takes. This adds little behavioral context beyond the tool name.

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 a single, tightly written sentence with no filler. The key action and target are front-loaded, and every word contributes to understanding the tool's purpose.

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?

For a simple two-parameter tool with full schema coverage, the description is minimally viable: an agent knows what the tool does and can pass the required path with an optional threshold. However, with no output schema and no mention of what the result looks like or what prerequisites exist, the description is not fully complete for confident invocation.

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 schema already documents both repositoryPath and riskThreshold with meaningful descriptions. The tool description adds no parameter-specific meaning, so the baseline score of 3 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 uses a specific verb ('Predict') and a clear resource ('files at risk of needing refactoring'), and the predictive angle distinguishes it from siblings like analyze_file, analyze_repository, and get_dependency_graph. Even without naming alternatives, an agent can tell this is forward-looking risk assessment rather than current-state analysis.

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 phrase 'based on trends and metrics' implies when the tool is relevant, but there is no explicit guidance on when to prefer it over siblings such as get_complexity_trends or analyze_repository. No exclusions or alternative routing is provided.

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