Skip to main content
Glama

git_restore

DestructiveIdempotent

Restore a single file in the mirror to its committed version, discarding uncommitted edits, then sync it into Studio.

Instructions

Overwrite one file in the mirror with its committed version: HEAD by default, or an older commit given as source. Uncommitted edits to that file are lost and cannot be recovered, so check git_diff first. The file sync then carries the restored script into Studio. For a file that was deleted use git_recover; for instances checkpointed in the place use restore.

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": "git_restore"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path relative to the mirror folder, as git_status or git_log prints it, e.g. "ServerScriptService/Main.server.luau".
placeNoTarget place (PlaceId or project name) whose mirror repo to use. Defaults to the bound/sole connected place.
sourceNoCommit or ref to take the file from, e.g. a hash or "HEAD~3". Omit to discard uncommitted changes and return to HEAD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / path / description
      Added value: +"File path relative to the mirror folder, as git_status or git_log prints it, e.g. \"ServerScriptService/Main.server.luau\"."
    • changedInput schema / properties / place / description
      Previous value: -"Target place (PlaceId or project name); defaults to the bound/sole place"New value: +"Target place (PlaceId or project name) whose mirror repo to use. Defaults to the bound/sole connected place."
    • changedInput schema / properties / source / description
      Previous value: -"commit/ref to restore the file FROM (e.g. a hash or HEAD~3)"New value: +"Commit or ref to take the file from, e.g. a hash or \"HEAD~3\". Omit to discard uncommitted changes and return to HEAD."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds the consequence the agent actually needs: uncommitted edits are lost and cannot be recovered. It also discloses a downstream side effect not present in any annotation, that the file sync carries the restored script into Studio.

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?

Three tight sentences, front-loaded with the action, then the data-loss warning, then the sibling routing. Every sentence carries distinct information and nothing is padded.

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

Completeness4/5

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

For a single-file restore with full schema coverage and a rich annotation set, the description covers action, risk, and side effects well. The only minor gap is that it never indicates what the call reports back, which matters somewhat since no output schema exists.

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 are already documented in the schema. The description only restates the default and override behavior of source and the fact that a single file is targeted, adding little beyond the structured fields. 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 specific verb and scope: "Overwrite one file in the mirror with its committed version," and immediately clarifies the default (HEAD) versus the override (older commit given as source). This separates it cleanly from git_recover and restore without the agent needing to open any 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?

Gives explicit routing: use git_recover for a deleted file, use restore for instances checkpointed in the place, and run git_diff first. Both alternatives and the precondition that selects them are named, so nothing is left to inference.

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