Skip to main content
Glama

git_restore

DestructiveIdempotent

Restore explicit permitted regular files destructively; refuse directory selectors and ambiguous transitions, omit repo_path to use the configured repository, and enforce project policy.

Instructions

Destructively restore explicit permitted regular files; directory selectors and ambiguous transitions are refused. Omit repo_path to use the configured repository. Results and operations are restricted according to project policy.

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
filesYes
sourceNo
stagedNo
worktreeNo
repo_pathNoOptional repository root. Omit to use the server's fixed repository. An explicit path must identify that same repository.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.10.19

TDQS

B3.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is structured. The description adds real value beyond that: refuses directory selectors and ambiguous transitions, and enforces project policy, which tells the agent failure modes it would otherwise hit blindly. Vagueness of 'ambiguous transitions' keeps it from a 5.

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

Conciseness4/5

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

Two dense sentences with the destructive scope front-loaded first. The trailing 'Results and operations are restricted according to project policy' is somewhat vague filler but does flag a real constraint, so it earns partial place.

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?

For a destructive mutation with five parameters and no output schema, an agent needs to know how source/staged/worktree interact to call it correctly. The description covers refusals and repo selection but leaves the core restore-target semantics undocumented, so it is not complete enough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 20% – only repo_path is documented. The critical semantics of source (which commit/HEAD), staged, and worktree are wholly unexplained in both schema and description, and these determine whether the restore targets index or working tree. The description does not compensate for that gap.

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?

States a specific verb (restore) and resource (regular files) with scope qualifiers ('explicit', 'destructively'), which separates it from read-only siblings like git_diff. It does not explicitly name related mutators such as git_reset or git_checkout, so an agent infers the boundary rather than being told.

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

Usage Guidelines3/5

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

It gives concrete constraints (directory selectors refused, ambiguous transitions refused, omit repo_path for the configured repo) and a policy-restriction caveat, but never states when to prefer this over git_reset or git_checkout. The usage boundary with siblings is implied rather than explicit.

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