Skip to main content
Glama

get_risk_hotspots

Read-onlyIdempotent

Identify code hotspots by combining cyclomatic complexity and git churn to prioritize refactoring efforts.

Instructions

Code hotspots: files with both high complexity AND high git churn (Adam Tornhill methodology). Score = complexity × log(1 + commits). 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 prediction 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
since_daysNoGit churn window in days (default: 90)
limitNoMax results (default: 20)
min_cyclomaticNoMin cyclomatic complexity to consider (default: 3)
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.
Behavior5/5

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

The description provides extensive behavioral details beyond annotations: the methodology (Adam Tornhill), formula, confidence_level interpretation, result envelope with _methodology disclosure and _warnings, requirement of git, read-only nature, and the JSON return format. No contradiction with annotations (readOnlyHint, destructiveHint, idempotentHint).

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 concise and well-structured: it starts with the core definition, then details formula, confidence, envelope, prerequisites, usage, alternative, and output format. Every sentence adds value, though the length could be slightly reduced without losing information.

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?

Given no output schema, the description adequately describes the return format (JSON with fields). It mentions the result envelope includes methodology disclosure and warnings but does not fully detail the envelope structure or error cases beyond git unavailability. Overall, it covers essential aspects.

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?

The input schema has 100% coverage, describing all parameters with defaults and enums. The description adds only minimal extra value regarding the 'toon' output format benefit. Since the schema already documents parameters well, a baseline score of 3 is appropriate.

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 clearly states the tool's purpose: identifying code hotspots using complexity and git churn (Adam Tornhill methodology). It provides the exact formula and distinguishes itself from the sibling tool predict_bugs by specifying its refactoring prioritization use case.

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

Usage Guidelines4/5

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

The description explicitly states when to use the tool ('prioritize refactoring') and directs to an alternative ('For per-file bug prediction use predict_bugs instead'). It also notes the prerequisite 'Requires git.' However, it does not explicitly list scenarios where the tool should not be used, though the context is clear.

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