Skip to main content
Glama

files_tool

Site file manager on the selected site (call select_site first). Proxies to /uapi/files with a server-minted Bearer key. Path is a parameter, never a URL suffix. Empty path is the site root, except content_get, content_put, and mkdir, where the API rejects it. Path bytes are only A-Z a-z 0-9 . _ / -; segments cannot be empty, ".", "..", or start with a dot. Batch upload, upload_url, rename with items, move with paths, and delete return the API body with results even when an item has state=error. A tool error is only a failed whole request (error.code). Read limits with action=quota; do not hardcode them. Shell fast path for binaries: never read binary files into model context. Mint upload_direct, POST raw bytes with curl to its upload_url, then pass the returned upload_id to action=upload with path (file manager) or to the module update as *_upload_id. Inline content_base64 is for small files only; large base64 produced by a model arrives truncated. Pass size and sha256 of the local file with inline bodies: a mismatch fails the call before anything is stored, and a successful upload returns sent with both. content_get reads text files only; anything else comes back as FM_NOT_TEXT or FM_TOO_LARGE_TO_READ.

Input Schema

TableJSON 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. Empty string is the site root. Folder for list, info, upload, upload_url, and move destination context; file for content_*; 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.
sortNolist: name (default), size, or mtime. Anything else is treated as name by the API.
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 API always returns HTTP 200 and results, even if name is also set.
limitNolist: slice length. 0 (default) means the rest of the listing.
orderNolist: asc (default). Only desc changes direction.
pathsNomove: sources to move; a non-empty list ignores path and always returns HTTP 200. delete: targets, together with path. Items are clean paths.
actionYeslist — GET /uapi/files (default path is root, sort=name, no filter). info — GET /uapi/files/info. content_get — GET /uapi/files/content. content_put — PUT /uapi/files/content. quota — GET /uapi/files/quota, no arguments. upload — POST /uapi/files/upload (multipart field file, repeatable); bytes come from files/content/content_base64 and from upload_id/upload_ids. upload_url — POST /uapi/files/upload_url. upload_direct — mint a one-shot curl URL (filename and size; call select_site first). POST the raw file to upload_url. The response is upload_id, filename, size, and sha256. Pass that upload_id to action=upload with path to place it in the file manager, or to content_tool or shop_tool as *_upload_id when updating the material. mkdir — POST /uapi/files/mkdir. rename — POST /uapi/files/rename (one object fails the request; items is always HTTP 200). move — POST /uapi/files/move (one path fails the request; paths is always HTTP 200). delete — DELETE /uapi/files (confirm; missing targets fail the request, otherwise HTTP 200 with results).
createNocontent_put: create the file when it does not exist. Default false. Parent folder must already exist.
filterNolist: a quota.limits.filters name, or a comma-separated extension list (png,jpg). Unknown names are ignored by the API.
offsetNolist: slice start after sorting. Default 0.
sha256Noupload: expected SHA-256 hex of the single top-level body after base64 decoding; a mismatch fails the call.
confirmNoRequired for delete after explicit user approval.
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. Foreign characters or a truncated length fail the call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • changedInput schema / properties / action / description
      Previous value: -"list — GET /uapi/files (default path is root, sort=name, no filter). info — GET /uapi/files/info. content_get — GET /uapi/files/content. content_put — PUT /uapi/files/content. quota — GET /uapi/files/quota, no arguments. upload — POST /uapi/files/upload (multipart field file, repeatable). upload_url — POST /uapi/files/upload_url. upload_direct — mint a one-shot curl URL (filename and size; call select_site first). POST the raw file to upload_url. The response is upload_id, filename, and size. Pass that upload_id to content_tool or shop_tool as *_upload_id when updating the material. mkdir — POST /uapi/files/mkdir. rename — POST /uapi/files/rename (one object fails the request; items is always HTTP 200). move — POST /uapi/files/move (one path fails the request; paths is always HTTP 200). delete — DELETE /uapi/files (confirm; missing targets fail the request, otherwise HTTP 200 with results)."New value: +"list — GET /uapi/files (default path is root, sort=name, no filter). info — GET /uapi/files/info. content_get — GET /uapi/files/content. content_put — PUT /uapi/files/content. quota — GET /uapi/files/quota, no arguments. upload — POST /uapi/files/upload (multipart field file, repeatable); bytes come from files/content/content_base64 and from upload_id/upload_ids. upload_url — POST /uapi/files/upload_url. upload_direct — mint a one-shot curl URL (filename and size; call select_site first). POST the raw file to upload_url. The response is upload_id, filename, size, and sha256. Pass that upload_id to action=upload with path to place it in the file manager, or to content_tool or shop_tool as *_upload_id when updating the material. mkdir — POST /uapi/files/mkdir. rename — POST /uapi/files/rename (one object fails the request; items is always HTTP 200). move — POST /uapi/files/move (one path fails the request; paths is always HTTP 200). delete — DELETE /uapi/files (confirm; missing targets fail the request, otherwise HTTP 200 with results)."
    • changedInput schema / properties / content_base64 / description
      Previous value: -"upload: base64 body of a single binary file when files is omitted."New value: +"upload: standard base64 body of a single binary file when files is omitted. Foreign characters or a truncated length fail the call."
    • addedInput schema / properties / files / items / properties / sha256
      Added value: +{
      +  "description": "Expected SHA-256 hex of this body after decoding.",
      +  "type": "string"
      +}
    • addedInput schema / properties / files / items / properties / size
      Added value: +{
      +  "description": "Expected byte size of this body after decoding.",
      +  "type": "number"
      +}
    • addedInput schema / properties / sha256
      Added value: +{
      +  "description": "upload: expected SHA-256 hex of the single top-level body after base64 decoding; a mismatch fails the call.",
      +  "type": "string"
      +}
    • changedInput schema / properties / size / description
      Previous value: -"upload_direct: exact byte size of the file that will be POSTed to upload_url (1..16777216). The curl body must match it exactly."New value: +"upload_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."
    • addedInput schema / properties / upload_id
      Added value: +{
      +  "description": "upload: 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.",
      +  "type": "string"
      +}
    • addedInput schema / properties / upload_ids
      Added value: +{
      +  "description": "upload: several upload_direct ids (a comma-separated string is accepted too), sent after upload_id and inline files. At most 20.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed4 schema fields changed
    • changedInput schema / properties / action / description
      Previous value: -"list — GET /uapi/files (default path is root, sort=name, no filter). info — GET /uapi/files/info. content_get — GET /uapi/files/content. content_put — PUT /uapi/files/content. quota — GET /uapi/files/quota, no arguments. upload — POST /uapi/files/upload (multipart field file, repeatable). upload_url — POST /uapi/files/upload_url. mkdir — POST /uapi/files/mkdir. rename — POST /uapi/files/rename (one object fails the request; items is always HTTP 200). move — POST /uapi/files/move (one path fails the request; paths is always HTTP 200). delete — DELETE /uapi/files (confirm; missing targets fail the request, otherwise HTTP 200 with results)."New value: +"list — GET /uapi/files (default path is root, sort=name, no filter). info — GET /uapi/files/info. content_get — GET /uapi/files/content. content_put — PUT /uapi/files/content. quota — GET /uapi/files/quota, no arguments. upload — POST /uapi/files/upload (multipart field file, repeatable). upload_url — POST /uapi/files/upload_url. upload_direct — mint a one-shot curl URL (filename and size; call select_site first). POST the raw file to upload_url. The response is upload_id, filename, and size. Pass that upload_id to content_tool or shop_tool as *_upload_id when updating the material. mkdir — POST /uapi/files/mkdir. rename — POST /uapi/files/rename (one object fails the request; items is always HTTP 200). move — POST /uapi/files/move (one path fails the request; paths is always HTTP 200). delete — DELETE /uapi/files (confirm; missing targets fail the request, otherwise HTTP 200 with results)."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "list",
      -  "info",
      -  "content_get",
      -  "content_put",
      -  "quota",
      -  "upload",
      -  "upload_url",
      -  "mkdir",
      -  "rename",
      -  "move",
      -  "delete"
      -]New value: +[
      +  "list",
      +  "info",
      +  "content_get",
      +  "content_put",
      +  "quota",
      +  "upload",
      +  "upload_url",
      +  "upload_direct",
      +  "mkdir",
      +  "rename",
      +  "move",
      +  "delete"
      +]
    • changedInput schema / properties / filename / description
      Previous value: -"upload: original name of a single file (multipart filename). Falls back to name."New value: +"upload and upload_direct: original file name (multipart filename). Falls back to name."
    • addedInput schema / properties / size
      Added value: +{
      +  "description": "upload_direct: exact byte size of the file that will be POSTed to upload_url (1..16777216). The curl body must match it exactly.",
      +  "type": "number"
      +}
  3. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.