Skip to main content
Glama

Diagnose hotspots (composite)

codetopo_diagnose_hotspot
Read-only

Rank code symbols by fan-in/out, blast radius, complexity, or centrality to find hotspots; report each one's neighborhood, external references, unresolved links, and index diagnostics.

Instructions

A composite over the atomic tools: the top-ranked symbols by the chosen measure, each with its blast-radius size, neighborhood size (depth 1), and the unresolved/external references touching it, plus the index-level diagnostics summary. Every number is an atomic query's output - the composite orchestrates and presents, it does not measure. What the graph could not resolve is stated per hotspot, never hidden.

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_diagnose_hotspot"
  }
}

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.10.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, openWorldHint=false, so the safety profile is covered. The description still adds real information beyond them: neighborhood is fixed at depth 1, each hotspot carries blast-radius size and unresolved/external references, there is an index-level diagnostics summary, and unresolved graph edges are 'stated per hotspot, never hidden.' It stops short of naming cost (this fans out to several atomic queries) or pagination behavior.

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, front-loaded with the payoff (what each hotspot contains) before the framing statement about the composite not measuring. The framing and the 'never hidden' line each do work by setting expectations about provenance and completeness. Slightly dense and faintly promotional in phrasing, but nothing is truly 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, the description must describe the return shape, and it does: rank-ordered hotspots with blast radius, depth-1 neighborhood, unresolved references, plus a diagnostics summary. For a three-parameter, read-only composite this is nearly sufficient. The gaps are the precise output structure and the fact that it fans out into multiple queries, which matters for an agent deciding between this and single atomic calls.

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%, including the enumerated values for `by` and the default of 20 for `limit`, so the schema carries the parameter burden and a 3 is the correct baseline. The description echoes a few of these ('the chosen measure', 'depth 1') but adds no new meaning, such as how ties are broken or what `limit` truncates relative to the diagnostics summary.

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 opens with a concrete composition: 'the top-ranked symbols by the chosen measure, each with its blast-radius size, neighborhood size (depth 1), and the unresolved/external references touching it, plus the index-level diagnostics summary.' That is a specific verb-plus-resource statement an agent can act on. It only gestures at 'the atomic tools' generically rather than naming codetopo_rank, codetopo_blast_radius, codetopo_neighborhood, or codetopo_diagnostics, so sibling differentiation is implied 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?

There is no explicit 'use this when' clause and no stated exclusion, so selection guidance is inferred from the word 'composite' and the note that it 'does not measure.' The clause 'Every number is an atomic query's output - the composite orchestrates and presents' hints that an agent wanting raw or single-fact measurement should reach for the atomic siblings, but it never says so directly.

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