Skip to main content
Glama

File history

file_history
Read-onlyIdempotent

Lists commits that changed a single file, newest first, following renames and showing paths and line changes so you can see how it evolved and who reworked it.

Instructions

List the commits on HEAD that changed a single file, newest first, following the file across renames. Each commit includes the path it had then and lines added/removed. Useful for "how did this file evolve?" and "who reworked it, and when?".

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": {
      "path": "<path>"
    },
    "name": "file_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesRepository-relative path of a single file, as named at HEAD.
repoNoRepo name or path; defaults to the first configured repo.
limitNoMaximum number of results.

Output Schema

NameRequiredDescriptionDefault
pathYesThe requested path, as it is named at HEAD.
repoYesName of the repository that was queried.
commitsYes
renamedYesTrue if the file had a different path in a listed commit.
truncatedYes
commitCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.5.0
    • 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."
    • removedOutput schema / properties / commits / items / properties / hash
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / commits / items / properties / shortHash / description
      Added value: +"Abbreviated hash; usable wherever a ref is accepted."
    • changedOutput schema / properties / commits / items / required
      Previous value: -[
      -  "hash",
      -  "shortHash",
      -  "author",
      -  "date",
      -  "subject",
      -  "path",
      -  "additions",
      -  "deletions"
      -]New value: +[
      +  "shortHash",
      +  "author",
      +  "date",
      +  "subject",
      +  "path",
      +  "additions",
      +  "deletions"
      +]
  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 readOnly/idempotent/non-destructive/openWorld=false, so the safety profile is covered. The description adds real behavioral value beyond that: newest-first ordering, rename-following semantics, and per-commit payload (historical path, lines added/removed).

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?

Two tightly written sentences: the core behavior and ordering are front-loaded, and the second sentence adds usage framing without redundancy. Nothing is wasted.

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 return values need not be fully explained, yet the description still previews the per-commit fields. With annotations covering safety and the schema covering parameters, nothing an agent needs to invoke this correctly is missing.

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 path, repo, and limit are already documented in the schema. The description adds no parameter syntax or format detail beyond what the schema provides; baseline 3 applies.

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?

Specific verb+resource+scope: 'List the commits on HEAD that changed a single file, newest first, following the file across renames.' An agent can distinguish it from commit_search or recent_activity by the single-file and rename-following scope, though no sibling is named explicitly.

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?

Provides clear motivating contexts ('how did this file evolve?' and 'who reworked it, and when?') that map to real agent intents. It stops short of naming alternatives or stating when not to use it (e.g., vs commit_search for content-based lookup).

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