Skip to main content
Glama

files_get_history

Retrieve a file's git commit history with commit hash, message, date, and author to understand its evolution before editing or restoring.

Instructions

Return the git commit history for one file (newest first), each entry with hash, message, date, and author. Reads the file's owning repo: the project's git repo for project files, the KB backup repo for KB files. Read-only; no side effects, auth, or rate limits. Returns {file_id, path, history}; an empty array means the file has not been committed yet. Use to understand a file's evolution before editing or restoring. Pair with files_get_diff to see exact line changes; use files_restore to roll back.

Input Schema

NameRequiredDescriptionDefault
file_idYesID of the file

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv6.1.2

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations present, the description carries the full behavioral burden and does so: it declares read-only, no side effects, no auth, no rate limits, and clarifies which repository is read (project git repo vs KB backup repo). It also explains the empty-array case, which is a meaningful edge condition.

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?

Front-loads the core behavior and return shape, then adds behavior, then usage routing. Every sentence contributes something (return contract, repo resolution, safety profile, empty-result meaning, sibling routing) with no filler.

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?

No output schema exists, yet the description supplies the return envelope (`{file_id, path, history}`), the entry shape, and the empty-array semantics. For a single-parameter read tool, nothing an agent needs to call or interpret it 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?

Only one parameter, and schema coverage is 100%, so the schema already documents file_id fully. The description adds mild interpretive value by explaining that the owning repo is resolved from the file (project vs KB), but adds no format or constraint details beyond that. Baseline 3 applies when the schema does the heavy lifting.

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?

States a precise verb+resource ('Return the git commit history for one file'), plus ordering ('newest first') and the per-entry fields (hash, message, date, author). An agent can immediately distinguish this from files_get_diff or files_restore without opening a schema.

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 names the use case ('understand a file's evolution before editing or restoring') and routes to two named siblings with their conditions: files_get_diff for exact line changes, files_restore to roll back. Both when-to-use and alternatives are covered.

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