Skip to main content
Glama

Revert a file to a previous commit

git_revert_file

Undo a bad edit by restoring one file to its state at a chosen commit, then automatically commit the revert.

Instructions

Restore one file to its state at a given commit (from git_history), then commit the revert. Use to undo a bad edit.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commitYesCommit hash from git_history, e.g. 'a1b2c3d'
filenameYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.1.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It discloses two key behaviors: restoring a single file and automatically committing the revert. This is important context that an agent needs before calling. However, it does not disclose whether the commit is created automatically with a generated message, whether the working directory must be clean, or what happens to uncommitted changes in that file—these are significant gaps for a mutating git operation.

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?

The description is two sentences with no filler. Every word earns its place: the action, the input source, the follow-up action, and the intended use case. It is front-loaded and easily scannable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is a mutating git operation with no annotations, no output schema, and two parameters. The description explains the core flow but misses several things an agent would need to know for safe invocation: whether the revert is committed immediately, how the commit message is generated, and any preconditions like a clean working tree. Given the complexity of git operations, the description is not fully complete.

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 50%: the 'commit' parameter has a description, but 'filename' has none. The description does not add extra meaning for the parameters, but it does indicate that the commit should come from git_history and the filename is the target file. This is about baseline level—it neither compensates for the missing 'filename' description nor adds meaningful detail beyond the schema.

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 clearly states the specific action: restore one file to a state at a given commit and commit the revert. It names the resource (file) and the source (git_history commit), which makes the tool's purpose unambiguous. However, it does not explicitly distinguish it from other file-related git tools beyond mentioning git_history, so it loses one point for lack of sibling differentiation.

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 includes the use case 'Use to undo a bad edit' and explicitly mentions pulling the commit from git_history, which provides clear context for when to use this tool. It does not explicitly state when not to use it or name an alternative tool, so it is a strong but not perfect usage guideline.

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

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/GOFORWRD/shopify-theme-mcp'

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