Skip to main content
Glama
UrbanDiver

Local DeepWiki MCP Server

by UrbanDiver

get_maintainability_metrics

Read-onlyIdempotent

Compute Maintainability Index for each function in a Python repository to identify hard-to-maintain code. Returns worst-scoring functions first, combining Halstead Volume, cyclomatic complexity, and lines of code.

Instructions

Compute Maintainability Index (MI) per function across a Python repository. MI combines Halstead Volume, cyclomatic complexity, and lines of code into a 0-100 score. Returns the worst-scoring functions first. Functions with MI < 20 are hard to maintain.

No prior indexing required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repo_pathYesPath to the repository
top_nNoNumber of top results to return (1-100, default: 20)
exclude_testsNoExclude test files from analysis (default: true)
Behavior4/5

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

The annotations already classify the tool as read-only, non-destructive, and idempotent. The description adds important behavioral details: it computes per-function, combines specific metrics, returns worst first, and notes the threshold. This provides context beyond the annotations.

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 three sentences long, front-loaded with the primary purpose, and contains no extraneous information. Every sentence adds value.

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?

For a tool with a clear purpose and well-described parameters, the description provides sufficient context: it explains the metric, output ordering, and preconditions (no indexing required). It lacks explicit mention of return format but is otherwise complete.

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?

The input schema already has 100% coverage with descriptions for all three parameters. The description does not add additional meaning to the parameters beyond what the schema provides, but it does not contradict or omit anything.

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 it computes the Maintainability Index per function, combining Halstead Volume, cyclomatic complexity, and lines of code into a 0-100 score. It specifies that results are ordered worst-first and highlights the threshold for hard-to-maintain functions. This distinguishes it from sibling tools like get_complexity_metrics or get_testability_metrics.

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?

The description indicates that no prior indexing is required, which is a key usage condition. It implicitly suggests using this tool to assess maintainability, but it does not explicitly contrast with alternative metrics tools or specify when not to use it.

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/UrbanDiver/local-deepwiki-mcp'

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