Skip to main content
Glama

restore_file

Restore an archived file from the archive/ folder to its original path and make it searchable again. Refuses to overwrite existing files, so nothing is lost.

Instructions

Restore an archived file from the top-level archive/ folder back to its original path (for example archive/notes/foo.md becomes notes/foo.md). The search index is updated immediately so the restored file is searchable again. Refuses to overwrite if a file already exists at the original path, and rejects directories, missing files, or paths not inside archive/. Paths are relative to the library root (MEMDRIVE_ROOT). Absolute paths are accepted only when they stay inside the root. The root is a hard sandbox: "../" escapes and symlinks pointing outside are rejected.

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

Input Schema

NameRequiredDescriptionDefault
pathYesArchived file to restore, relative to the library root — must start with "archive/" (for example "archive/notes/2026-10-28.md").

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.0

TDQS

A4.1/5.0
Behavior4/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 immediate search-index side effect, the no-overwrite safety behavior, and the sandbox rules for absolute paths, `../` escapes, and out-of-root symlinks. It stops short of describing the success response or what happens to file metadata/permissions on restore.

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?

Core action and the transformation example are front-loaded, and each follow-on sentence adds a distinct behavior (index update, overwrite refusal, sandbox). The final three path-policy sentences are dense and slightly repetitive with the schema, keeping it from a perfect score.

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 one-parameter mutation tool with no annotations and no output schema, the definition covers side effects, failure modes, and path safety thoroughly. The main remaining gap is the return value on success, which nothing else in the structured data supplies.

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 `path` parameter is already documented in the schema with the required `archive/` prefix. The description reinforces this and adds real meaning about absolute paths being accepted only inside the root and symlink rejection, but most of that is framed as tool-level policy rather than per-parameter guidance, so it stays near the baseline.

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 (restore) and resource (an archived file) plus the exact scope: the top-level `archive/` folder. The inline example (`archive/notes/foo.md` becomes `notes/foo.md`) makes the transformation unambiguous and distinguishes it from `archive_file`, its inverse.

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?

The refusal conditions (existing file at destination, directories, missing files, paths outside `archive/`) effectively define when the tool will not work, giving clear context for use. It never explicitly routes the agent to an alternative such as `save_file` for non-archived files, so the alternative-selection guidance is implied rather than stated.

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