Skip to main content
Glama

rank_repository_pagerank

Rank repository modules by PageRank centrality over AST import graphs to identify core architectural modules versus peripheral utilities.

Instructions

Identifies the architectural backbone and most critical modules of any repository using graph-theory PageRank centrality over AST import and reference topologies. Ranks modules by inbound/outbound degree and structural criticality.

Behavior:

  • Read-only: Graph centrality computation; does not alter files.

  • Idempotent: Deterministic PageRank convergence for identical import graphs.

  • 100% Offline: Fully local graph traversal without external dependencies.

Usage Guidelines:

  • When to use: Run when exploring an unfamiliar codebase to immediately identify the core architectural modules versus peripheral utilities.

  • Sibling Routing: For direct pairwise dependencies of a file, use 'query_module_dependencies'. For blast radius of a single function, use 'analyze_change_impact'.

Returns: Ranked Markdown table with PageRank centrality scores, inbound/outbound degrees, and architectural significance notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_kNoNumber of top central modules to return in the ranking report (default: 15).
project_rootNoRoot directory of the repository to analyze (default: current directory)..

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / project_root / description
      Added value: +"Root directory of the repository to analyze (default: current directory)."
    • addedInput schema / properties / top_k / description
      Added value: +"Number of top central modules to return in the ranking report (default: 15)."
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so: it declares read-only, idempotent/deterministic convergence, and fully offline execution, and explains the ranking semantics (inbound/outbound degree, structural criticality). This is far beyond what a bare tool name would convey.

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?

Front-loaded one-sentence purpose, then labeled Behavior / Usage / Returns blocks. Every line carries routing or behavioral information; there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so the brief 'Returns' line is a bonus rather than a requirement. Combined with the routing guidance and behavioral notes, an agent has everything needed to select and call this tool correctly.

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 top_k and project_root are already fully documented in the schema. The description adds no syntax or format detail beyond that, so the baseline 3 applies even though nothing is missing.

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?

States a specific verb and resource ('identifies the architectural backbone and most critical modules') and names the mechanism (PageRank centrality over AST import/reference topologies). This is unmistakably distinct from siblings like query_module_dependencies or generate_architecture_blueprint.

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?

Explicit 'When to use' condition (exploring an unfamiliar codebase to separate core modules from peripheral utilities) plus a 'Sibling Routing' block that names two alternatives and the exact condition selecting each. Nothing is left to inference.

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