Skip to main content
Glama

restore

Revert chosen files to an earlier commit or just before it, undoing later changes and saving the result as a new commit.

Instructions

Go back to a version: the files become what they were in that commit (before=true: what they were just before it, undoing it and everything after, as going back to before a message). paths= only those files. Nothing is lost: the restore is a commit of its own, and restoring its parent undoes it.

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": {
      "commit": "<commit>"
    },
    "name": "restore"
  }
}

Input Schema

NameRequiredDescriptionDefault
basisNoWhat you read and followed to make this change, as refs from search or lookup: rule:<lint or taste rule>, taste, feedback:<id> (earlier feedback this follows; what it answers goes in feedback), commit:<id> (an earlier change it builds on), asset:, template:, skill:… The person sees them under the change, so they know why it is this way. Name only what shaped it.
pathsNo
beforeNo
commitYes
messageNoOne line saying why, kept with the change in the history
feedbackNoIds of the feedback this change answers (notes and marks from list_notes, list_examples or the conversation). When the person keeps the change it joins the record of that feedback, and when they then mark the feedback resolved it is the fix; when they take it back, the feedback opens again.
confidenceNoHow sure you are this change is what the person wants. high: they asked for exactly this, or you measured it against a reference. medium: you inferred it from the taste, a rule or earlier feedback. low: you are guessing, or it changes something they did not ask about. The person's threshold decides which changes stand by themselves and which wait for them to keep; say it honestly on every change.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.2
    • addedInput schema / properties / confidence
      Added value: +{
      +  "description": "How sure you are this change is what the person wants. high: they asked for exactly this, or you measured it against a reference. medium: you inferred it from the taste, a rule or earlier feedback. low: you are guessing, or it changes something they did not ask about. The person's threshold decides which changes stand by themselves and which wait for them to keep; say it honestly on every change.",
      +  "enum": [
      +    "high",
      +    "medium",
      +    "low"
      +  ]
      +}
  2. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already flag this as a non-read-only, non-destructive, non-idempotent write. The description adds the crucial trait annotations cannot express: the operation is reversible because it creates its own commit, and restoring the parent undoes it. That directly explains why destructiveHint=false is credible, though it says nothing about permissions or how the new change is reported back.

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?

The core meaning is front-loaded in the first clause, and every following sentence adds a distinct rule (before semantics, path scoping, reversibility). The nested parenthetical is dense and slightly run-on, but no sentence is filler.

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 7-parameter mutation tool with no output schema, the description covers the semantics that would otherwise be opaque: version selection, before-mode, path scoping, and undo behavior. It is thin only on what the call returns (e.g., the resulting change/commit identifier) and on failure conditions.

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

Parameters4/5

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

With 57% schema coverage, the three undocumented-in-schema parameters (commit, before, paths) are exactly the ones the description explains: what commit means, what before=true does, and that paths limits to only those files. The remaining parameters (basis, message, feedback, confidence) carry their own schema descriptions, so little is left ambiguous.

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?

"Go back to a version: the files become what they were in that commit" gives a specific verb (go back/restore) and resource (files at a commit), and the before/paths clauses sharpen the scope. It does not name a sibling to contrast with, so an agent must still infer that diff/compare are read-only alternatives.

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?

It clearly states the two usage modes (plain restore to a commit vs before=true to undo that commit and everything after) and how paths narrows the operation. What is missing is any explicit exclusion or named alternative for read-only inspection of history.

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

Deploy Server

Other Tools