Skip to main content
Glama

Restore a file version

files_restore
Destructive

Put a file back to one of its saved versions: this is the undo. Use it when an edit broke the app or the user asks to revert, and to bring back a file that was deleted. Call files.history first for the versionId. What it replaces is itself saved, so a restore can be undone in turn.

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": {
      "id": "<id>",
      "path": "<path>",
      "versionId": "<versionId>"
    },
    "name": "files_restore"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
pathYesThe file to put back, volume-root relative, e.g. '/index.js'.
versionIdYesThe id of the version to restore, exactly as files.history returned it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and idempotent=false, but the description adds the crucial mitigating fact that 'what it replaces is itself saved, so a restore can be undone in turn' – information an agent cannot get from the annotations. It does not cover permissions or whether in-flight references are affected, which keeps it below 5.

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?

Four short sentences, front-loaded with the action and its undo framing, then triggers, then prerequisite, then reversibility note. Nothing is redundant with the title.

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 3-parameter mutation with no output schema, the description covers triggers, prerequisite lookup, deleted-file recovery, and reversibility. Only the meaning of the 'id' parameter and any permission constraints are missing.

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 coverage is 67%; path and versionId are already documented in the schema, and the description largely restates the versionId provenance that the schema itself states. The undocumented 'id' parameter gets no explanation in the description either, so it adds only marginal meaning.

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?

Specific verb+resource ('put a file back to one of its saved versions') with a memorable framing ('this is the undo') and an extra scope note that it also brings back deleted files. An agent can distinguish this from backups_restore and files_write without opening a schema.

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?

Gives three concrete triggers (a broken edit, an explicit revert request, a deleted file) and a required workflow step: call files.history first for the versionId. It does not explicitly rule out backups_restore as the alternative for whole-volume recovery, so a small gap remains.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources