Skip to main content
Glama

Delete an uploaded file

wp_delete_upload_file
Destructive

Delete one file from the uploads directory (wp-content/uploads). Returns deleted, file and undo (token for wp_undo that puts the file back; null when no undo point could be recorded, e.g. undo switched off or the file too large, and the delete still happens). Only the file goes: a media library entry pointing to it stays. Folders and AlphaBridge's own folders are refused. Administrators only (manage_options). Attachments together with their files are deleted by wp_delete_media. Forwarded by AlphaBridge Connect to the one site this connection reaches.

Input Schema

NameRequiredDescriptionDefault
fileYesPath of one file relative to the uploads directory, e.g. "2026/07/old.pdf", as wp_list_uploads lists it; ".." and symlinked files are refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / file / description
      Added value: +"Path of one file relative to the uploads directory, e.g. \"2026/07/old.pdf\", as wp_list_uploads lists it; \"..\" and symlinked files are refused."
  2. Added

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructive/non-idempotent, but the description goes well past them: it discloses the exact return payload, that the undo token can be null while the delete still succeeds, and the partial-effect trap that a media library entry is left dangling. It also names the auth requirement and the proxy/forwarding boundary — exactly the context annotations cannot express.

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?

Front-loaded with the action and location, then returns, then caveats, then the sibling alternative and deployment note. Every sentence carries a distinct fact (undo semantics, orphaned media entry, refusals, auth, proxy scope) with no restatement of the title.

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?

No output schema exists, and the description compensates by enumerating the returned fields and the null-undo edge case. Combined with the auth and forwarding constraints, an agent has everything needed to call this safely and interpret the result.

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% and the single `file` parameter already documents relative-path format, the wp_list_uploads reference shape, and the ".."/symlink refusals. The description adds no parameter-level detail beyond echoing the folder refusal, so baseline 3 applies.

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?

States a specific verb and resource with scope ("Delete one file from the uploads directory (wp-content/uploads)"), and explicitly distinguishes itself from the nearest sibling wp_delete_media. An agent can route between wp_list_uploads, wp_read_upload_file, wp_delete_upload_file and wp_delete_media from this description alone.

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?

Gives explicit when-to-use-other guidance ("Attachments together with their files are deleted by wp_delete_media"), plus a prerequisite (Administrators only / manage_options) and named refusal cases (folders, AlphaBridge's own folders, ".." and symlinks). Nothing about selection is left to inference.

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.

Resources