Skip to main content
Glama
MCP Git Server

MCP Git Server

by mpfilbin

git_restore

Restore specified files in a Git working tree or staging area to undo local changes and recover file contents. Use it to revert unwanted edits or unstage modifications.

Instructions

Restore working tree files

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": {
      "files": "<files>"
    },
    "name": "git_restore"
  }
}

Input Schema

NameRequiredDescriptionDefault
filesYesFiles to restore
stagedNoRestore files in the staging area
repoPathNoPath to git repository (defaults to current directory)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden, and it omits the single most important trait: restoring overwrites uncommitted local changes in the working tree, which is destructive. It also says nothing about the effect of the staged flag beyond the schema's own one-liner or about what the command returns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four words with no padding, so it is certainly concise, but it is terse to the point of under-specification for a tool that can silently destroy local edits. Brevity here costs more than it saves.

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

Completeness2/5

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

With no annotations, no output schema, and a potentially destructive git operation, the description should explain risk, mode behavior, and relationship to sibling tools. Instead it supplies a single four-word phrase, leaving major gaps for a mutation tool.

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 all three parameters (files, staged, repoPath) are documented in the schema itself, which sets the baseline at 3. The description adds no meaning beyond that, such as what happens when files lists paths that are untracked or already clean.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a verb plus resource ("Restore working tree files"), which is more than a tautology, but it never distinguishes itself from close siblings like git_checkout or git_reset, which can also restore files. An agent cannot tell from this sentence which of those to pick.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites (must be in a repo, whether uncommitted work is at risk), and no mention of the alternative tools. The agent is left to infer everything from the name.

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