Skip to main content
Glama

Delete, move, upload or restore files and folders

manage_files
Destructive

Deletes, moves, uploads or restores files in an Overleaf project's local clone, or discards local changes, staging all edits until you push them to Overleaf.

Instructions

Change which files and directories the project's local clone holds, or throw local work away; action picks what. delete removes a file, or a directory with everything in it. move renames a file or a directory or moves it inside the project, creating missing parent directories and refusing a toPath that already exists or lies inside the directory being moved. upload adds a file byte for byte, such as a figure, a PDF, a data file or a .bib from elsewhere, copied from sourcePath on this computer or decoded from contentBase64, and replaces a file already at path; edit_file is for text written in the call itself. restore puts a file back to exactly what it was at revision, binary files included, and brings back a file deleted since; find the revision with read_history. discard_local_changes permanently throws away every local edit, new file and unpushed commit in the project, fetching Overleaf first so the clone ends up matching its current version; call it only once the user has said the work should be abandoned, typically after push_changes refuses a conflicting change. Nothing reaches Overleaf until push_changes, and until then discard_local_changes undoes any of these; review them with read_project (view changes). LaTeX references are not rewritten: after a move or delete, search_project for the old path and fix what still names it with edit_file. Uploads over 50 MB and files under a hidden directory such as ~/.ssh are refused. An upload turns off text-only checkout for the project so the new file is committed with the rest, and so does deleting or moving a directory that holds files text-only checkout keeps off disk, so those files go with it. Every action except discard_local_changes pulls from Overleaf first, and fails, keeping local work, if that pull conflicts with it. Returns what was changed, or why nothing was.

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": {
      "action": "<action>"
    },
    "name": "manage_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNodelete, move, upload and restore, required: a path relative to the project root, as read_project (view files) prints it, e.g. sections/intro.tex. delete and move take a file or a directory, move at its current path; upload and restore take the file to write.
actionYesWhat to do: delete, move, upload, restore (a file from an earlier revision) or discard_local_changes (every local change in the project, permanently).
toPathNomove, required: the new path, relative to the project root, e.g. sections/intro.tex. Must stay inside the project and must not already exist.
projectNoWhich project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project.
revisionNorestore, required: the commit hash to restore the file from, as read_history prints it.
sourcePathNoupload: absolute path of the file on this computer to copy, e.g. /Users/me/results/plot.png. Give this or contentBase64.
contentBase64Noupload: the file's content, base64-encoded, for content that is not on disk. Give this or sourcePath.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the destructive/non-idempotent/open-world profile; the description adds the specifics an agent cannot infer: nothing reaches Overleaf until push_changes, discard permanently destroys unpushed commits, every action except discard pulls from Overleaf first and fails while keeping local work on conflict, 50 MB and hidden-directory refusals, and text-only checkout being silently disabled by upload or directory delete/move.

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 the overall purpose and 'action picks what' before drilling into each action, and nearly every sentence carries operational information (limits, side effects, sequencing). It loses a point for being one dense block of run-on sentences where per-action content would scan better, plus minor duplication of path semantics already in the schema.

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 7-parameter, five-action destructive tool with no output schema, the description covers side effects, failure modes, ordering relative to push_changes, size/location limits, and even the return contract ('Returns what was changed, or why nothing was'). Nothing an agent needs to invoke it safely is missing.

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 3 is the baseline; the description earns extra by adding constraints beyond the schema, notably that move refuses a toPath that 'lies inside the directory being moved', that upload replaces an existing file at path, and that path follows the format read_project prints. It does not restate the sourcePath/contentBase64 exclusivity that the schema already covers.

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?

Names a concrete verb and resource family ('change which files and directories the project's local clone holds') and immediately enumerates the five actions with per-action verb+object definitions. It distinguishes itself from neighbours by naming edit_file, push_changes, read_history, read_project and search_project and saying how they relate.

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?

Explicit routing: 'edit_file is for text written in the call itself' vs upload for byte-for-byte copies, 'find the revision with read_history', 'review them with read_project (view changes)'. It also gives a strong precondition for the riskiest action — discard_local_changes 'only once the user has said the work should be abandoned, typically after push_changes refuses a conflicting change'.

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