Skip to main content
Glama

get_risk_hotspots

Read-onlyIdempotent

Identify code hotspots where high complexity meets high git churn to prioritize refactoring. Returns scored files with confidence levels for heuristic triage.

Instructions

Code hotspots: files with both high complexity AND high git churn (Adam Tornhill methodology). Score = complexity × log(1 + commits). This is a heuristic triage ranking, not a validated risk metric — churn alone correlates only moderately with where bugs are later fixed (Spearman ~0.3 on this repo via scripts/calibrate-health-metrics.mjs), so treat the ranking as "look here first", not a guarantee. Each entry includes a confidence_level (low/medium/multi_signal) counting how many of the two independent signals fired strongly. Result envelope includes _methodology disclosure and _warnings when git is unavailable. Requires git. Use to prioritize refactoring. For per-file bug-risk triage use predict_bugs instead. Read-only. Returns JSON: { hotspots: [{ file, score, complexity, commits, confidence_level }], total }. Set output_format: "toon" for lossless TOON encoding — cheaper LLM tokens on tabular payloads.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMax results (default: 20)
since_daysNoGit churn window in days (default: 90)
output_formatNoOutput format. "json" (default) returns JSON, "markdown" returns LLM-friendly fenced markdown (tool-specific), "toon" returns Token-Oriented Object Notation — 30-60% fewer tokens on tabular data, fully lossless.
min_cyclomaticNoMin cyclomatic complexity to consider (default: 3)
Behavior5/5

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

Discloses that the ranking is a heuristic, not a validated risk metric, provides correlation data (Spearman ~0.3), explains confidence levels, and notes that the result envelope includes methodology disclosure and warnings when git is unavailable. Annotations indicate read-only and idempotent, and description adds depth without contradiction.

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?

The description is longer but each sentence adds value: methodology, usage, limitations, output format detail. It is front-loaded with the core concept, though slightly verbose but still effective.

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?

Covers methodology, heuristic nature, result structure (JSON with hotspots array and total), confidence levels, output format options, alternative tool, and prerequisites. With no output schema, the description fully explains return values and envelope fields.

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?

Schema coverage is 100%, and the description adds extra context for the 'output_format' parameter (TOON encoding benefit). This exceeds the baseline of just relying on schema descriptions.

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?

Clearly states the tool identifies files with high complexity and high git churn, using Adam Tornhill methodology. The verb 'get' and resource 'risk hotspots' are specific, and it distinguishes itself from the sibling 'predict_bugs' by stating that for per-file bug-risk triage, use that instead.

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?

Explicitly says 'Use to prioritize refactoring' and directs to 'predict_bugs' for bug-risk triage. Also notes 'Requires git', providing clear context for appropriate use.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikolai-vysotskyi/trace-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server