Skip to main content
Glama

restore_file

Destructive

Restore a trashed file or folder to its original location, undoing a non-permanent delete. Recovers items from trash by file ID; permanently deleted files cannot be recovered.

Instructions

Restore a trashed file or folder back to its original location — undoes delete_file when it was called without permanent=True. Raises an API error (does not silently no-op) if the file was permanently deleted or otherwise no longer exists — permanent deletion can't be recovered from.

Args: file_id: The ID of the trashed file or folder to restore.

Returns: Confirmation with fileId and action taken ('restored').

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": {
      "file_id": "<file_id>"
    },
    "name": "restore_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_idYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only supply destructiveHint=true, so the description adds real value: it discloses error semantics ('Raises an API error, does not silently no-op') and the irreversibility of permanent deletion. Missing disclosure of failure modes such as an occupied original location or permission requirements, which matters for a mutation tool. The description does not contradict the destructive hint.

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?

Front-loaded with purpose, then failure behavior, then Args/Returns — the ordering matches how an agent needs the information. Minor redundancy between 'Raises an API error ... if the file was permanently deleted' and the trailing restatement 'permanent deletion can't be recovered from.'

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 single-parameter mutation tool with an output schema, the definition covers purpose, preconditions, and failure behavior, so an agent has enough to invoke it correctly. The Returns section is somewhat redundant given the output schema, and permission/location-collision behavior is left unstated.

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 description coverage is 0%, so the description carries the burden and does: it defines `file_id` as the ID of the trashed file or folder, clarifying that folders are valid targets, not just files. It adds no format/syntax detail, but the added semantic scope is the meaningful part.

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 ('a trashed file or folder') plus the destination ('back to its original location'), and explicitly ties its purpose to the sibling `delete_file` by naming the inverse relationship. An agent can distinguish it from delete/copy/move siblings without opening any 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?

Clearly frames the condition under which the tool applies: undo of `delete_file` when called without `permanent=True`. It also states the negative case (permanently deleted items cannot be recovered) rather than letting the agent discover it via failure. No explicit instruction on what to do instead when the item is permanently gone, which keeps it from a 5.

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