Skip to main content
Glama

Delete files from the server

ptero_delete_file
DestructiveIdempotent

Permanently delete files or directories on a Pterodactyl server with two-phase confirmation, automatic backup, and protection for critical paths. Requires explicit approval to prevent irreversible data loss.

Instructions

Permanently delete one or more files or directories. THIS IS IRREVERSIBLE WITHOUT A BACKUP — the panel has no trash and no undo. Deleting a directory deletes everything under it. Prefer ptero_rename_file (rename it out of the way) whenever the change might need undoing.

Every guardrail applies:

  • Deletion is OFF unless the operator set PTERODACTYL_ALLOW_DELETE=true; otherwise every call is refused.

  • Paths matching PTERODACTYL_PROTECTED_PATHS are refused — by default the world directories, server.properties, ops.json, whitelist.json and banned-*.json.

  • More than 10 files in one call is refused; narrow the list and work in batches.

  • An automatic backup is taken before the delete, and the operation is aborted if the backup fails.

The first call does NOT delete anything. It returns status "needs_confirmation" with a preview listing the root, the exact files and the count, plus a single-use token that expires in 120 seconds. THAT PREVIEW IS FOR THE HUMAN: put it in your reply, let them read the list, and only call again with the confirmation_token once they have said yes. Do not round-trip the token automatically — the whole point is that a person sees what is about to be destroyed.

Use dry_run=true if you only want to check what a delete would resolve to.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootNoDirectory the entries in `files` live in, relative to the server root. Defaults to `/`. E.g. `plugins` when deleting `foo.jar`./
filesYesNames to delete, relative to `root` — bare names such as `foo.jar`, not full paths. Maximum 10 per call. Directories are deleted with all their contents.
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.
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
rootNo
filesNoNames deleted, relative to `root`.
reasonNoWhy the call was refused.
serverYes
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
deleted_countNo
confirmation_tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Discloses irreversibility, no trash/undo, recursive directory deletion, automatic backup before delete, and the two-phase confirmation with token expiry. This goes well beyond the destructiveHint/readOnlyHint annotations and explains the preview/confirmation behavior that annotations alone would 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?

Long but justified for a destructive tool: the warning is front-loaded, guardrails are bulleted, and the confirmation protocol is clearly sequenced. No filler.

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?

Covers operator-controlled enablement, protected paths, batch limits, backup behavior, and the human-in-the-loop confirmation flow. With an output schema present, nothing needed to call it correctly is missing.

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 coverage is 100%, so the schema already documents root, files, server, dry_run, and confirmation_token in detail. The description reinforces key constraints (batch limit, token binding, preview-for-human) but adds little parameter-specific meaning beyond the schema.

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 opens with 'Permanently delete one or more files or directories' — a specific verb and resource. It also names the safer sibling ptero_rename_file, distinguishing this destructive tool from the alternative.

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?

Explicitly says to prefer ptero_rename_file when a change might need undoing. It also details when deletion is refused (PTERODACTYL_ALLOW_DELETE, protected paths, >10 files) and mandates the two-phase human confirmation workflow.

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