Skip to main content
Glama
mcp-synology

mcp-synology

restore_from_recycle_bin

Destructive

Restore deleted files or folders from a shared folder's recycle bin to their original locations or a chosen folder, with optional overwrite for existing items.

Instructions

Restore deleted files or folders from one shared folder's recycle bin. Check what's there first with list_recycle_bin: every path must be in that share's bin, or nothing is restored; an empty item, naming the whole bin, is refused. Without dest_folder, each item goes back to its original folder, which is re-created if it's gone. An item whose name is already at the destination is skipped and stays in the bin, unless overwrite=true, which replaces the existing one, which may then not be in the recycle bin; two items that would replace each other are refused. A long restore keeps running on the NAS and returns a handle for file_task. While this user's running task is landing the same name there, the call is refused if either one replaces. That can miss another account's task or a start at the same moment from another server process, and DSM's tasks if its task list fails; overwrite=false never replaces.

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": {
      "share": "<share>",
      "paths": "<paths>"
    },
    "name": "restore_from_recycle_bin"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsYesItems to restore, as paths in the bin the way list_recycle_bin shows them (`Shows/Ep1.mkv`); full paths such as `/video/#recycle/Shows/Ep1.mkv` work too.
shareYesThe shared folder whose bin holds the items, as a name (`video`) or path (`/video`).
overwriteNoReplace an item already at the destination; a replaced file may not be in the recycle bin (default false: it's skipped and stays in the bin).
dest_folderNoAn existing folder to restore everything into, flat (default: each item's original folder).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.1
    • changedInput schema / properties / overwrite / description
      Previous value: -"Replace an item already at the destination (default false: it's skipped and stays in the bin)."New value: +"Replace an item already at the destination; a replaced file may not be in the recycle bin (default false: it's skipped and stays in the bin)."
  2. Changed5 schema fields changedv0.9.1
    • addedInput schema / properties / dest_folder / description
      Added value: +"An existing folder to restore everything into, flat (default: each item's original folder)."
    • addedInput schema / properties / overwrite / description
      Added value: +"Replace an item already at the destination (default false: it's skipped and stays in the bin)."
    • addedInput schema / properties / paths / description
      Added value: +"Items to restore, as paths in the bin the way list_recycle_bin shows them (`Shows/Ep1.mkv`); full paths such as `/video/#recycle/Shows/Ep1.mkv` work too."
    • addedInput schema / properties / share / description
      Added value: +"The shared folder whose bin holds the items, as a name (`video`) or path (`/video`)."
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "tool_restore_from_recycle_binOutput",
      -  "type": "object"
      -}New value: +null
  3. Addedv0.7.1

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare destructiveHint=true; the description spells out what is actually destroyed (an overwritten file 'may then not be in the recycle bin'), the default safe behavior (skipped items stay in the bin), the all-or-nothing validation, and the long-running async behavior that returns a handle for file_task. It also discloses the limits of its own concurrency protection — other accounts' tasks, simultaneous starts from another server process, and DSM tasks when the task list fails — which is exactly the kind of caveat annotations cannot carry.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and virtually every clause carries real information, but the middle section is a run-on chain of 'which/unless/which' clauses, and the concurrency passage ('While this user's running task is landing the same name there, the call is refused if either one replaces. That can miss another account's task or a start at the same moment from another server process, and DSM's tasks if its task list fails') is dense enough to require re-reading. Restructuring those caveats as discrete conditions would preserve the content at lower parsing cost.

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 destructive, async-capable multi-item operation with no output schema, the description covers the safety profile, validation model, destination semantics, and the file_task handoff. It stops short of saying what the immediate response contains (items restored vs. skipped vs. refused) when the restore is not long-running, which is the one thing an agent would still have to discover by calling it.

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?

Schema coverage is 100%, so the baseline is 3, and the description earns above that by adding behavior the schema omits: without dest_folder the original folder is 're-created if it's gone,' dest_folder flattens everything into one existing folder, and overwrite=false 'never replaces' even under a name conflict. The remaining gap is that it never notes what happens when dest_folder doesn't exist.

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?

Opens with a specific verb and resource: 'Restore deleted files or folders from one shared folder's recycle bin.' The scope (single share) is stated immediately, and the sibling list_recycle_bin is named as the inspection counterpart, so the agent can separate this from the read-only listing tool 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 Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit prerequisite sequence — 'Check what's there first with list_recycle_bin' — and states the precondition that every path must belong to that share's bin or nothing is restored. It also names the refusal cases (empty item, whole-bin reference), which is the when-not side of the guidance.

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