Skip to main content
Glama

Rank symbols by a measurement

codetopo_rank
Read-only

Rank code symbols by fan-in, fan-out, blast radius, complexity, or centrality measures to identify high-impact or highly connected code; non-converging measures are reported as absent.

Instructions

The top symbols by fan-in, fan-out, blast-radius size, cyclomatic complexity, or a centrality measure (pagerank, betweenness, closeness, eigenvector, katz) - measurements over the graph, with the measurement's method stated in the result. A measure that does not converge on the graph is reported as an absence with its reason, never a partial result. A ranking of measurements, never a score of code quality.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "db_path": "<db_path>"
    },
    "name": "codetopo_rank"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoMetric to rank by: fan_in, fan_out, blast_radius (default), complexity, pagerank, betweenness, closeness, eigenvector, or katz.
limitNoMaximum entries to return. Default 20.
db_pathYesPath to the index database.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.9.0
    • changedInput schema / properties / by / description
      Previous value: -"Metric to rank by: fan_in, fan_out, blast_radius (default), or complexity."New value: +"Metric to rank by: fan_in, fan_out, blast_radius (default), complexity, pagerank, betweenness, closeness, eigenvector, or katz."
  2. Changed1 schema field changedv0.7.0
    • changedInput schema / properties / by / description
      Previous value: -"Metric to rank by: fan_in, fan_out, or blast_radius (default)."New value: +"Metric to rank by: fan_in, fan_out, blast_radius (default), or complexity."
  3. Addedv0.6.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds real behavioral context beyond that: the measurement's method is echoed in the result, and non-converging measures are reported as an absence with a stated reason rather than a truncated ranking. That is a non-obvious failure mode an agent would otherwise have to discover by trial.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, no filler, and the essential scoping caveats are packed into the last two lines. It opens with a noun-phrase fragment rather than a verb, so the operation is slightly back-loaded, but nothing is redundant.

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 and only three parameters, the description covers the important gaps by explaining what the result contains (the measure's method) and how failures surface (absence plus reason). The default metric is left to the schema, which is acceptable at 100% coverage. An agent has enough to call it correctly and interpret the response.

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%, so all three parameters including the metric enum and the limit default are already documented in structured form. The description repeats the metric list but adds no syntax, format, or interaction detail (e.g. how limit interacts with ties or whether centrality measures are expensive). Baseline 3 applies when the schema carries the parameter burden.

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 names the resource (symbols) and the operation (top-N ranking) and enumerates the metric families it ranks by, so an agent can tell it produces orderings rather than raw statistics. The closing line 'a ranking of measurements, never a score of code quality' further narrows what the output means. It stops short of naming the closest siblings (codetopo_metrics, codetopo_blast_radius), so the differentiation is implicit rather than explicit.

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?

Usage is only implied: the enumeration of metrics and the 'never a score of code quality' caveat suggest when to reach for this versus codetopo_metrics, but there is no explicit when-to-use/when-not statement. Nothing tells the agent whether this replaces or complements codetopo_blast_radius when blast_radius is the chosen measure, despite blast_radius being both a parameter value and a sibling tool.

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