Skip to main content
Glama
UrbanDiver

Local DeepWiki MCP Server

by UrbanDiver

get_cohesion_metrics

Read-onlyIdempotent

Analyzes class and module cohesion using LCOM4 and internal-import ratio. Identifies classes with low cohesion that may benefit from splitting.

Instructions

Analyze class and module cohesion. Reports LCOM4 (Lack of Cohesion of Methods) for each class and internal-import ratio for each package. Classes with LCOM4 > 1 may be candidates for splitting. Modules with low cohesion ratio rely heavily on external imports.

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?

Annotations already declare read-only, non-destructive, idempotent behavior. The description adds value by detailing what metrics are reported (LCOM4, internal-import ratio) and that no prior indexing is required, which aligns with 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?

Three short sentences: first states purpose, second gives interpretation, third is a prerequisite note. No wasted words, front-loaded with key information.

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?

Covers purpose, metrics, interpretation, and a prerequisite (no indexing). With no output schema, it explains what is returned. Could hint at performance for large repos, but overall adequate for a cohesion 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 coverage is 100% with clear descriptions for all three parameters. The description adds marginal value by noting that no prior indexing is needed, which indirectly relates to the repo_path parameter.

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 that it analyzes class and module cohesion, reports LCOM4 and internal-import ratio. It distinguishes itself from siblings like get_complexity_metrics or get_coupling_metrics by focusing specifically on cohesion 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?

Provides context on when to use (for cohesion analysis) and gives interpretation tips (e.g., LCOM4 > 1 suggests splitting). However, it does not explicitly list alternatives or when not to use this tool among many siblings.

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