Skip to main content
Glama

Delete a media item

delete_media
Destructive

Permanently delete a WordPress media file from disk. Requires explicit confirmation to prevent accidental loss; broken images may appear if content still references it.

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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv2.0.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / id / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / id / minimum
      Added value: +-9007199254740991
  2. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already mark destructiveHint true and readOnlyHint false, but the description adds crucial non-obvious consequences: attachments bypass the trash, files are permanently removed from disk, and references break. This goes beyond the structured metadata and directly prevents an agent from treating this as a reversible delete.

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?

Three short sentences: purpose, irreversible behavior/requirement, and side-effect warning. No filler, and the most safety-critical statement is front-loaded after the purpose.

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 delete operation, the description covers what is deleted, what the caller must provide, what happens to the file, and downstream consequences. Combined with full schema parameter docs and destructive annotations, nothing essential is missing for correct invocation.

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%, with confirm already documented as required and irreversible, id as attachment ID, and site_id with usage details. The description repeats the confirm requirement, which reinforces it, but does not add meaning beyond the schema for the parameters.

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 opening phrase 'Delete a media item' states a specific verb and resource, and the WordPress attachment detail makes the target unambiguous among delete_* siblings. Even without naming alternatives, an agent cannot confuse this with delete_content, delete_plugin, or delete_user.

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

Usage Guidelines4/5

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

The description explicitly instructs callers to set confirm: true and warns why, which is a concrete usage rule. It does not name alternatives or exclusions, but the media-specific scope makes the appropriate context clear.

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

Deploy Server

Other Tools