Skip to main content
Glama
codedev-mcp

codedev-mcp

by Kranthithota

code_metrics

Read-onlyIdempotent

Calculate lines of code, comment ratios, complexity scores, and file size distribution per file, directory, or entire codebase to assess maintainability and identify complex areas.

Instructions

Calculate code metrics: lines of code, comment ratios, complexity scores, file size distribution. Works per-file, per-directory, or codebase-wide.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "code_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFile or directory to analyze (default: entire codebase)
sort_byNoSort files by metric (default: lines)
languageNoFilter by language

Output Schema

NameRequiredDescriptionDefault
languagesYes
blankLinesYes
totalFilesYes
totalLinesYes
commentLinesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.2.5

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and openWorldHint=false, so the safety profile is covered by structured data. The description adds only the scope flexibility (whole codebase vs single file), and an output schema exists to cover return values. Little additional behavioral context is offered beyond that.

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?

Two tight sentences with zero filler; the metric inventory comes first and the scoping note second, so the most decision-relevant information is front-loaded.

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?

With a documented output schema, rich annotations, and fully described parameters, the description only needs to convey what is measured and at what granularity, both of which it does. The remaining gap is guidance on choosing this tool over metric-specific siblings, which is a minor omission for an analysis tool.

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 all three parameters carry inline descriptions, so the baseline is 3. The description's metric list loosely maps to the sort_by enum values (lines, complexity, size), but it adds no syntax, default, or format detail beyond the schema.

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 gives a specific verb ('Calculate') plus the resource ('code metrics') and enumerates the metric families: lines of code, comment ratios, complexity scores, file size distribution. It also states the three scopes (per-file, per-directory, codebase-wide), which helps distinguish it from narrower siblings like find_large_files or find_long_functions, though it never names those alternatives.

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 'Works per-file, per-directory, or codebase-wide' clause implies how to target the tool via the path parameter, so usage is partly inferable. However, nothing states when to prefer this aggregate metrics tool over focused siblings such as find_large_files, find_long_functions, or find_duplicates, and there are no exclusions or prerequisites.

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