Skip to main content
Glama

Delete a media item

delete_media
Destructive

Permanently delete a WordPress media attachment, removing the file from disk. Requires confirm: true because deletion is irreversible and any references will break.

Instructions

Delete a media item. Attachments bypass the trash by default in WordPress, so deletion removes the file from disk permanently and requires confirm: true. Any content still referencing the file will show a broken image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe attachment ID.
confirmNoRequired — the file is removed from disk and cannot be recovered.
site_idNoWhich configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids.
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false. The description goes further by explaining that deletion is permanent, bypasses the trash, requires confirm, and leaves broken images for referencing content – valuable context beyond the annotation.

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 two sentences, front-loaded with the core action, and every clause adds significant meaning. No waste.

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

Completeness4/5

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

Despite no output schema, the description covers key behavioral consequences (permanent deletion, broken references) and the confirm requirement. It doesn't address errors or permissions, but given the tool's simplicity and annotation coverage, it is adequately complete.

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%, and the description echoes the confirm requirement without adding new meaning for id or site_id. The description adds little beyond the schema, so the 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?

The description states 'Delete a media item' with a specific verb and resource, and adds crucial detail about attachments bypassing the trash and permanent deletion, distinguishing it from generic delete tools like delete_content or delete_comment.

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

Usage Guidelines3/5

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

The description implies the tool is for media items but does not explicitly contrast with sibling delete tools or state when to use it instead of them. It provides behavioral context (permanent deletion, confirm requirement) but no direct guidance on selection among alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alokemajumder/wpxmcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server