Skip to main content
Glama
papyruslabs-ai

Seshat

Official

Get Coupling Metrics

get_coupling_metrics
Read-onlyIdempotent

Measure code coupling, cohesion, and instability by module or layer to identify refactoring candidates and architectural hotspots.

Instructions

Measure how tangled your code is. Returns coupling (cross-boundary dependencies), cohesion (within-group dependencies), and instability scores. High coupling + low cohesion = refactoring candidates. Start with group_by: "layer" for the architectural health view ("are my controllers more coupled than my services?"), then drill into group_by: "module" for specific hotspots.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoProject name (required in multi-project mode). Use list_projects to see available projects.
group_byNoGroup entities by module or layer (default: module)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.20.2

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds analytical context (the coupling/cohesion heuristic, the drill-down sequence) but says nothing about computation cost, result size, or freshness. It does not contradict 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?

Three compact sentences, front-loaded with what is measured, then the interpretation heuristic, then the recommended call sequence. No filler.

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 two-parameter, read-only analytical tool with full schema coverage and annotations, the description covers purpose, output semantics, and usage sequencing well. It could be more explicit that the tool returns aggregates rather than per-entity lists, but nothing essential is missing.

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%, so the enum values for group_by and the project parameter are already documented. The description reinforces the practical use of each enum value ("layer" for architecture, "module" for hotspots), which is useful for choosing between them but adds no syntax or format detail beyond the schema.

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 uses a specific verb+resource ("Measure... coupling metrics") and enumerates exactly what is returned: coupling, cohesion, and instability scores. This is distinct from siblings like get_dependencies or get_topology, which return structural graphs rather than quantified metrics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It prescribes a concrete workflow: start with group_by: "layer" for architectural health, then drill into group_by: "module" for hotspots. This tells the agent not just when to use the tool, but how to sequence calls.

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