Skip to main content
Glama

file_version_restore

Restore a file to a saved version by replacing its current content with the selected version ID. The overwritten content is saved as a new version when overwrite protection is enabled.

Instructions

Replace a file's content with one of its versions (version_id from file_versions). Needs edit rights (files.modify); the content it replaces is kept as a version first. A file an app has locked answers LOCKED.

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>",
      "version_id": "<version_id>"
    },
    "name": "file_version_restore"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesadapter:// path of the file
version_idYesthe version to bring back (an id file_versions answers)
snapshot_currentNokeep the current content as a version first (the server already does this when its overwrite guard is on, the default)

Output Schema

NameRequiredDescriptionDefault
resultYesthe operation's JSON answer - the body its REST twin under /api/ai answers (an object)
statusYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does well: it discloses the permission requirement, the safety behavior (replaced content is kept as a version first), and a named error outcome (LOCKED). It stops short of stating whether the operation is reversible beyond that guard or what the response contains.

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?

Three short sentences, front-loaded with the action, then prerequisites, then the edge case. No filler; the parenthetical about file_versions is slightly redundant but only a phrase.

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?

Covers permission, overwrite-safety semantics, and a specific error state for a mutation tool with no annotations, and an output schema handles return values. Only marginally incomplete for not naming any alternative tool for reverting in other ways.

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 100% and the schema already documents all three fields, including that snapshot_current defaults on via the server's overwrite guard. The description's mention of the version_id source largely repeats the schema, so the baseline 3 applies.

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 resource ('Replace a file's content with one of its versions') and scopes the version_id source to file_versions, which separates it from sibling file_versions (listing) and file_snapshot. An agent can identify the operation without opening the 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 the precondition (needs edit rights, files.modify) and the failure condition (app-locked file answers LOCKED), plus a pointer to file_versions for obtaining the id. It does not explicitly contrast with snapshot/restore alternatives, but the context for calling it is clear.

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