Skip to main content
Glama

File hotspots

file_hotspots
Read-onlyIdempotent

Rank files by commit count and bug-fix frequency over a selected time window to spot churn, risky areas, and refactoring candidates.

Instructions

Rank files by how many commits changed them in the last N days (merge commits excluded), with how many of those commits were fixes. Pass types: ["fix"] to rank by bug fixes only and find the files that keep breaking. Useful for spotting churn, risky areas and refactoring candidates.

Input Schema

NameRequiredDescriptionDefault
daysNoTime window in days.
pathNoRestrict to this file or directory.
repoNoRepo name or path; defaults to the first configured repo.
limitNoMaximum number of results.
typesNoOnly count commits of these conventional-commit types, e.g. ["fix"]. Commits without a type count as "fix" when their subject mentions fix, bug or hotfix.
excludeNoGlob patterns for files to leave out, e.g. ["*.lock", "dist/", "docs/**/*.md"]. A pattern without "/" matches at any depth; a trailing "/" excludes a directory.

Output Schema

NameRequiredDescriptionDefault
repoYesName of the repository that was queried.
typesYesCommit types counted; null means all commits.
hotspotsYes
windowDaysYes
filesChangedYes
scanTruncatedYes
commitsMatchedYesScanned commits that passed the types filter.
commitsScannedYes
fixesFromKeywordsYesCounted fixes that have no conventional-commit header and were recognized by words like "fix" or "bug" in the subject. Non-zero means fix counts are an estimate.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv0.5.0
    • changedInput schema / properties / days / description
      Previous value: -"Size of the time window in days."New value: +"Time window in days."
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results (1-100)."New value: +"Maximum number of results."
    • changedInput schema / properties / repo / description
      Previous value: -"Repository name or absolute path from the allowlist. Defaults to the first configured repo."New value: +"Repo name or path; defaults to the first configured repo."
    • addedInput schema / properties / types
      Added value: +{
      +  "description": "Only count commits of these conventional-commit types, e.g. [\"fix\"]. Commits without a type count as \"fix\" when their subject mentions fix, bug or hotfix.",
      +  "items": {
      +    "pattern": "^[a-zA-Z]{1,20}$",
      +    "type": "string"
      +  },
      +  "maxItems": 12,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedOutput schema / properties / commitsMatched
      Added value: +{
      +  "description": "Scanned commits that passed the types filter.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / fixesFromKeywords
      Added value: +{
      +  "description": "Counted fixes that have no conventional-commit header and were recognized by words like \"fix\" or \"bug\" in the subject. Non-zero means fix counts are an estimate.",
      +  "type": "number"
      +}
    • addedOutput schema / properties / hotspots / items / properties / fixes
      Added value: +{
      +  "description": "How many of those commits were fixes.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / hotspots / items / required
      Previous value: -[
      -  "path",
      -  "changes",
      -  "additions",
      -  "deletions",
      -  "authors",
      -  "lastChanged"
      -]New value: +[
      +  "path",
      +  "changes",
      +  "fixes",
      +  "additions",
      +  "deletions",
      +  "authors",
      +  "lastChanged"
      +]
    • addedOutput schema / properties / types
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Commit types counted; null means all commits."
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "repo",
      -  "windowDays",
      -  "commitsScanned",
      -  "scanTruncated",
      -  "filesChanged",
      -  "hotspots"
      -]New value: +[
      +  "repo",
      +  "windowDays",
      +  "types",
      +  "commitsScanned",
      +  "scanTruncated",
      +  "commitsMatched",
      +  "fixesFromKeywords",
      +  "filesChanged",
      +  "hotspots"
      +]
  2. First observedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint/idempotentHint/non-destructive, so the safety bar is low; the description adds real behavioral context beyond them by disclosing that merge commits are excluded and how the 'fix' classification is derived. It does not mention cost, ordering ties or result shape, but the output schema covers returns.

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?

Three sentences, each earning its place: the metric, an example invocation, and the analytical use case. The core ranking rule is front-loaded with the qualifying details appended.

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 a rich schema, full annotations and an output schema, the description only needs to convey what the tool computes, which it does clearly. Minor omissions — default 90-day window relevance and that filtering is scoped by repo/path — are adequately covered by the schema itself.

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 description coverage is 100%, so the baseline is 3, and the description adds genuine meaning on top: it demonstrates the purpose of the `types` parameter with a concrete example (["fix"]) and explains what that filter is for. The remaining parameters (days, path, repo, limit, exclude) get no additional description-side semantics.

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 gives a precise verb+resource+metric: 'Rank files by how many commits changed them in the last N days (merge commits excluded), with how many of those commits were fixes.' That is far more specific than the bare title 'File hotspots'. It does not explicitly contrast itself with likely-confusable siblings such as change_coupling, file_history or code_age, so it falls short of a 5.

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?

It states concrete use contexts ('spotting churn, risky areas and refactoring candidates') and gives a motivating configuration ('Pass types: ["fix"] ... find the files that keep breaking'). There is no explicit when-not-to-use or named alternative tool, which keeps it below 5.

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