Skip to main content
Glama

Coupling and cohesion metrics

codetopo_metrics
Read-only

Measure coupling and cohesion for each code type and package, including CBO, RFC, LCOM, TCC, ATFD, WMC, Ca, Ce, and instability, with every metric method stated in results.

Instructions

Coupling and cohesion measurements for every type and package (CODE_SCHEMA section 9): CBO, RFC, LCOM pair counts, TCC, ATFD, WMC per type; Ca, Ce, instability, and separately-named external coupling per package. Every metric's method is stated in the result. Measurements only - no thresholds, no verdicts.

Input Schema

NameRequiredDescriptionDefault
db_pathYesPath to the index database.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.7.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the read-only, closed-world safety profile, and the description adds genuinely useful context on top: every metric's method is reported in the result, and no thresholds or verdicts are applied. That tells the agent the output is self-documenting raw measurement, which is not derivable from 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?

Two dense sentences, front-loaded with the scope and metric inventory, closing with the behavioral caveat. No filler and nothing that doesn't earn its place.

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 no output schema, the description does the necessary work of listing what comes back and at what grain (per type and per package), plus the note that methods are embedded in results. It does not mention result volume or how types/packages are identified, which a caller interpreting the payload might want.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Single required parameter with 100% schema description coverage, so the schema fully carries parameter meaning and no extra description text is needed. The description correctly avoids restating db_path.

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?

States a specific measurement domain ('coupling and cohesion measurements for every type and package') and enumerates the actual metrics (CBO, RFC, LCOM, TCC, ATFD, WMC, Ca, Ce, instability). An agent can tell this apart from codetopo_rank or codetopo_stats by the metric vocabulary, though no sibling is named explicitly.

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?

'Measurements only - no thresholds, no verdicts' implicitly signals that this is the raw-metric tool rather than a scoring/ranking one, but the description never says when to reach for it versus codetopo_rank or codetopo_stats. Usage is inferable, not stated.

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