Skip to main content
Glama

Trash or restore a file

trash_file
DestructiveIdempotent

Move a Google Drive file or folder to the trash to delete it reversibly, or restore it later. Trashed items stay recoverable for about 30 days until auto-purge.

Instructions

action=trash moves a file (or folder, with everything inside) to the Drive trash; action=restore brings it back. Trashing is REVERSIBLE — the file stays recoverable until the trash auto-purges it after ~30 days — and is the safe default whenever a user asks to 'delete' something: only use delete_file_forever when they explicitly want it gone beyond recovery. Trashed files disappear from search_files unless include_trashed=true. Only the owner (or a shared-drive member with the right role) can trash; restore puts the file back at its old parent. Returns id, name, trashed and explicitlyTrashed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYestrash = move to the trash (reversible); restore = take it back out.
file_idYesThe file id — the long id from the Drive URL (drive.google.com/file/d/<fileId> or docs.google.com/.../d/<fileId>/edit) or from search_files/get_file output. Folders and shared-drive items are files too.
Behavior5/5

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

The description goes well beyond the annotations by disclosing reversibility, the ~30-day auto-purge window, permission requirements, restore behavior, and the effect on search_files. It also states that trashing a folder includes everything inside, which is important behavioral context the annotations do not convey.

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?

The description is dense but every sentence contributes meaningful information: what the actions do, reversibility and safety, search visibility, permissions, and return values. It front-loads the core action semantics and avoids redundant fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with no output schema, the description is complete: it explains both actions, side effects, permission constraints, visibility in search, and exactly what the response contains. An agent has enough context to invoke the tool correctly and understand the consequences.

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?

The input schema already documents both parameters thoroughly, so the baseline is 3. The description adds extra meaning by explaining folder behavior, the reversible nature of the trash action, and restore's return to the old parent, which enriches the parameter semantics beyond the schema alone.

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?

The description clearly states a specific action (trash or restore) on a specific resource (files/folders) and explains the two action values. It also distinguishes this tool from delete_file_forever, making its purpose unambiguous relative to siblings.

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?

The description explicitly says trashing is the safe default whenever a user asks to 'delete' something, and instructs that delete_file_forever should only be used when the user explicitly wants permanent deletion. It also provides operational context such as how trashed files behave in search_files, giving clear when-to-use guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A1-x-Tech/mcp-google-drive'

If you have feedback or need assistance with the MCP directory API, please join our Discord server