Skip to main content
Glama

Edit site files

files_write
Destructive

Uploads files (text, base64 or URL), writes text files, creates folders, renames and moves items in the site file manager.

Input Schema

NameRequiredDescriptionDefault
urlNoupload_url: http:// or https:// URL that ends with a file name and extension.
fileNoupload: synonym for a single text body when files and content are omitted.
nameNoupload: saved name when the request has exactly one file. upload_url: saved name, or the last URL segment when omitted. rename: new leaf name (no slashes) for a single object.
pathNoClean path without edge slashes, passed as a parameter (never as a URL suffix). Empty string is the site root; content_get, content_put and mkdir need a non-empty path. Allowed bytes are A-Z a-z 0-9 . _ / -; segments cannot be empty, ".", "..", or start with a dot. Folder for list, info, upload, upload_url and move; file for content_get and content_put; new folder for mkdir; source for rename, move and delete.
sizeNoupload_direct: exact byte size of the file that will be POSTed to upload_url (1..16777216). The curl body must match it exactly. upload: expected byte size of the single top-level body after base64 decoding; a mismatch fails the call before anything is stored.
filesNoupload: one or more files. Each item is { filename, content } or { filename, content_base64 }. Sent as a repeated multipart field named file. name applies only when this list has one file and no extra top-level body.
itemsNorename batch: map of leaf name to new leaf name inside path. When this object is present the call always returns results per item, even if name is also set.
pathsNomove: sources to move; a non-empty list ignores path and always returns results per item. delete: targets, together with path. Items are clean paths.
actionYesOperation to run. Each oneOf entry describes one action and lists its parameters.
createNocontent_put: create the file when it does not exist. Default false. Parent folder must already exist.
sha256Noupload: expected SHA-256 hex of the single top-level body after base64 decoding; a mismatch fails the call before anything is stored.
contentNocontent_put: new file text (empty string is allowed). upload: text body of a single file when files is omitted.
filenameNoupload and upload_direct: original file name (multipart filename). Falls back to name.
add_wmarkNoupload and upload_url: apply the site watermark when it is enabled and the extension is an allowed image.
upload_idNoupload: id from upload_direct whose bytes were already POSTed. Saved into path under its upload_direct filename, or name when it is the only file. Spent only when that item is uploaded; otherwise it stays usable until it expires.
upload_idsNoupload: several upload_direct ids (a comma-separated string is accepted too), sent after upload_id and inline files. At most 20.
destinationNomove: existing destination folder. Empty string is the site root.
content_base64Noupload: standard base64 body of a single binary file when files is omitted. Inline base64 suits small files only: a long base64 body produced by a model arrives truncated. Foreign characters or a truncated length fail the call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / action / oneOf
      Previous value: -[
      -  {
      -    "const": "content_put",
      -    "description": "Writes text into a file. Required: path, content. Optional: create."
      -  },
      -  {
      -    "const": "upload",
      -    "description": "Uploads one or more files into the folder path. Bytes come from files, content, content_base64, file, upload_id and upload_ids. Pass size and sha256 with inline bodies; a successful upload returns sent with both. Returns per-item results. Optional: path, files, content, content_base64, file, filename, name, size, sha256, upload_id, upload_ids, add_wmark."
      -  },
      -  {
      -    "const": "upload_url",
      -    "description": "Downloads a file from a public URL into the folder path. Returns per-item results. Required: url. Optional: path, name, add_wmark."
      -  },
      -  {
      -    "const": "upload_direct",
      -    "description": "Creates a one-time upload URL for a file of the given name and exact size, so binary files never pass through the model context. POST the raw bytes to the returned upload_url (for example with curl); the response is upload_id, filename, size and sha256. Pass upload_id to upload (with path), or as *_upload_id to the content and shop write tools. Required: filename, size."
      -  },
      -  {
      -    "const": "mkdir",
      -    "description": "Creates a folder. Required: path."
      -  },
      -  {
      -    "const": "rename",
      -    "description": "Renames one item (path and name) or several items in the folder path (items). Batch form returns per-item results. Required: path. Optional: name, items."
      -  },
      -  {
      -    "const": "move",
      -    "description": "Moves path, or every item of paths, into destination. The paths form returns per-item results. Required: destination. Optional: path, paths."
      -  }
      -]New value: +[
      +  {
      +    "const": "content_put",
      +    "description": "Writes text into a file. Required: path, content. Optional: create."
      +  },
      +  {
      +    "const": "upload",
      +    "description": "Uploads one or more files into the folder path. Bytes come from files, content, content_base64, file, upload_id and upload_ids. Pass size and sha256 with inline bodies; a successful upload returns sent with both. Returns per-item results. Optional: path, files, content, content_base64, file, filename, name, size, sha256, upload_id, upload_ids, add_wmark."
      +  },
      +  {
      +    "const": "upload_url",
      +    "description": "Downloads a file from a public URL into the folder path. Returns per-item results. Required: url. Optional: path, name, add_wmark."
      +  },
      +  {
      +    "const": "upload_direct",
      +    "description": "Creates a one-time upload URL for a file of the given name and exact size, so binary files never pass through the model context. POST the raw bytes to the returned upload_url (for example with curl); the response is upload_id, filename, size and sha256. Pass upload_id to upload (with path), or as *_upload_id to the content and shop write tools. Required: filename or name, size."
      +  },
      +  {
      +    "const": "mkdir",
      +    "description": "Creates a folder. Required: path."
      +  },
      +  {
      +    "const": "rename",
      +    "description": "Renames one item (path and name) or several items in the folder path (items). Batch form returns per-item results. Required: path. Optional: name, items."
      +  },
      +  {
      +    "const": "move",
      +    "description": "Moves path, or every item of paths, into destination. The paths form returns per-item results. Required: destination. Optional: path, paths."
      +  }
      +]
  2. Added

TDQS

C2.9/5.0
Behavior2/5

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

The annotations already declare destructiveHint=true and openWorldHint=true, but the description does not explain what may be overwritten or destroyed, whether operations are atomic, how partial per-item failures behave, or what permissions are required. It mostly restates the operation list already present in the schema.

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?

The description is a single front-loaded sentence with no filler, which is appropriately concise. However, for a multi-action destructive tool, the flat operation list could be structured more helpfully around action selection.

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

Completeness3/5

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

The schema is unusually rich, with per-action oneOf descriptions and full parameter documentation, and the annotations cover the safety profile. The description itself remains minimal and omits sibling routing and overwrite/destruction specifics, so it is adequate but not fully complete for a complex 18-parameter write tool.

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 description coverage is 100%, so the schema already documents all 18 parameters and the action enum in detail. The description only broadly mentions text, base64, and URL uploads and does not add parameter-level meaning beyond that baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names specific write operations: uploading files, writing text, creating folders, renaming and moving items in the site file manager. It clearly identifies a file-mutation tool, but it does not explicitly distinguish itself from siblings such as files_read, files_delete, or content_write.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

The description states what operations are available but gives no guidance on when to use this tool versus files_read, files_delete, content_write, or other write tools. It also omits prerequisites and conditions for choosing among its own actions, leaving selection to the schema.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.