Skip to main content
Glama

Upload a local file to the server

ptero_upload_file
DestructiveIdempotent

Upload binary files from your local machine to a Pterodactyl game server without data corruption. Handles jars, zips, and other non-text files byte-for-byte.

Instructions

Upload a file from the machine running this MCP server to the game server, BYTE FOR BYTE. This is the tool for binaries — plugin jars, zips, datapack archives, images, region files — anything ptero_write_file cannot carry because that tool is text-only and would corrupt non-UTF-8 bytes.

You pass a PATH, not content: local_path must be an absolute path to a file that already exists on the machine this server runs on, and the server reads the bytes itself. There is no way to hand it base64 or any other inline payload, so if the file only exists in this conversation, write it to local disk first and pass that path.

It uploads exactly one file and does not unpack anything: a .zip or .tar.gz arrives as an archive, still compressed. There is no decompress tool here.

Creating a NEW remote file runs immediately. OVERWRITING an existing one is destructive: the first call returns status "needs_confirmation" with a preview (remote path, current size, new size) and a confirmation_token, and an automatic backup is taken before the upload happens. Show that preview to the human and only call again with the token once they have agreed. Protected paths (PTERODACTYL_PROTECTED_PATHS) are refused outright, and files larger than 64 MiB are refused before anything is read or sent.

VERIFY AFTERWARDS. The panel hands out a short-lived signed URL and the node answers the upload with an empty 200 — that confirms receipt and nothing more. It does not tell you the file landed at the size you sent, and it never tells you whether the server will accept it. Call ptero_list_files on remote_dir and check the size against the bytes this tool reports. A new plugin jar also needs a server restart before it loads.

The file content is never written to the audit log — only its sha256 and length — and neither is the signed upload URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNoServer short identifier (e.g. 1a2b3c4d). Omit to use PTERODACTYL_DEFAULT_SERVER. Call ptero_list_servers to discover valid identifiers.
dry_runNoWhen true, validate and preview the change without performing it. Nothing is modified and no confirmation token is issued. Use this to reason about an operation before committing to it.
local_pathYesABSOLUTE path on the machine running this MCP server, e.g. `/Users/me/build/MyPlugin-1.2.0.jar`. Must be an existing, readable, regular file (not a directory, not a device) of at most 64 MiB. Relative paths are refused: this process's working directory is not something you can see.
remote_dirNoDestination DIRECTORY on the game server, relative to the server root — not the destination file path. Defaults to `/` (the server root). Examples: `plugins`, `plugins/Geyser-Spigot`. The file name comes from `remote_name`/`local_path`./
remote_nameNoFile name to use on the server. Defaults to the basename of `local_path`. This is a single name, not a path: it must not contain `/`. Use `remote_dir` to choose the directory.
confirmation_tokenNoTwo-phase confirmation token. Leave this out on the first call: the tool will refuse to act and instead return a preview of exactly what would change, plus a single-use token that expires in 120 seconds. THE PREVIEW IS FOR THE HUMAN — show it to the user in your reply and let them decide. Do not silently round-trip the token back in an immediate second call. Only call again with the token once the user has seen the preview and approved it. The token is bound to a hash of these exact arguments, so changing any argument invalidates it.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoServer-relative path the bytes were uploaded to.
bytesNoSize of the local file, in bytes, as sent.
actionNo
reasonNoWhy the call was refused.
serverYes
sha256Nosha256 of the LOCAL file. Compare it against the uploaded file yourself if it matters.
statusYessuccess = the change was made. refused = a guardrail blocked it (see reason/variable). dry_run = nothing changed; preview shows what would. needs_confirmation = nothing changed; SHOW the preview to the human and, only if they agree, call again with confirmation_token.
messageNo
previewNoWhat would / did change.
variableNoEnvironment variable that caused the refusal.
backup_idNoUUID of the automatic pre-change backup, if one was taken.
expires_in_sNo
confirmed_viaNo
confirmation_tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Even though annotations already mark destructiveHint=true, the description adds substantial operational detail: overwriting is two-phase with a preview and single-use token, automatic backup is taken, protected paths are refused, files over 64 MiB are refused, the empty 200 confirms only receipt not integrity, and the audit log excludes file content and signed URLs. This materially exceeds what the annotations alone 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 long but front-loads the core purpose and key constraint in the first sentence, then each paragraph delivers a distinct operational fact: binary vs text, path semantics, no unpacking, confirmation flow, verification, and audit behavior. Every sentence carries safety or correctness consequence, so nothing feels wasted.

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 destructive, high-stakes upload tool with an output schema, this description covers every operational concern an agent needs: when to write content to disk first, the two-phase confirmation protocol with human-in-the-loop expectations, size and path refusals, how to verify success via ptero_list_files, and server restart implications. Nothing relevant to correctly invoking the tool is left unexplained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, and the description adds further meaning on top: local_path must be absolute and existing on the MCP host with no inline payload possible, remote_dir is a directory not a destination path, remote_name must not contain '/', and confirmation_token is tied to the exact arguments and expires in 120 seconds. This gives an agent the operational context the schema alone does not fully imply.

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 names a specific verb and resource: 'Upload a file from the machine running this MCP server to the game server, BYTE FOR BYTE.' It explicitly distinguishes itself from the sibling ptero_write_file by noting that tool is text-only and corrupts non-UTF-8 bytes, so an agent can immediately tell which tool fits a binary file.

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 gives explicit when-to-use guidance: use this for binaries such as plugin jars, zips, and images, and names ptero_write_file as the alternative that should not be used for non-UTF-8 content. It also gives post-use verification guidance via ptero_list_files and notes that archives are not decompressed, so no decompress tool is expected.

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