Skip to main content
Glama
nagavitalp

code-health-mcp

by nagavitalp

analyze_file

Analyze a source code file to produce readability, maintainability, and complexity metrics, helping identify refactoring risks and quality issues.

Instructions

Analyze a single source code file for readability, maintainability, and complexity metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesPath to the source code file to analyze

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 carries the full burden, yet it does not disclose side effects, whether the file is modified, limitations, or what behavior to expect beyond 'analyze.' It does not even explicitly state it is read-only.

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?

A single focused sentence with no filler; the key scope ('single source code file') is front-loaded and the metric categories are listed compactly.

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 one-parameter schema and 100% coverage, the core is clear, but there is no output schema and the description does not explain what the analysis result looks like or any side effects, leaving an important gap for an agent.

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%, and the filePath description already defines the parameter fully. The tool description adds no new parameter semantics, so the baseline 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 states a specific action (analyze), a concrete resource (a single source code file), and the metrics computed (readability, maintainability, complexity). The word 'single' and 'file' distinguishes it from the sibling analyze_repository, so an agent can identify its scope.

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 implies file-level use via 'single source code file' but never explicitly states when to prefer it over siblings or excludes repository/temporal analysis. No alternative or when-not guidance is given.

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