Skip to main content
Glama

Delete a media file

delete_media
DestructiveIdempotent

Permanently delete a media file from the library. Refused with a conflict (MEDIA_IN_USE) while the file is still used by a post that has not published yet (draft, scheduled, pending approval or publishing) or by a template; the error lists those posts and templates, so detach the file with update_post / update_template or remove them with archive_post / delete_template first. A 502 (MEDIA_STORAGE_DELETE_FAILED) means storage refused the file and nothing was deleted: the file is still in the library, so call delete_media again later rather than reporting it gone.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mediaId": "<mediaId>"
    },
    "name": "delete_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
mediaIdYesThe media ID (from list_media)
organizationIdNoOrganization to act in — an id from list_organizations. Required when this connection was authorized for more than one organization; omit it when there is only one.

Output Schema

NameRequiredDescriptionDefault
successNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description goes further by naming the concrete failure mode (MEDIA_IN_USE with enumerated draft/scheduled/pending/publishing states and templates), explaining that the error payload lists the blocking posts and templates, and clarifying that a 502 leaves the file intact and retryable. That is real behavioral context beyond the structured hints, though it does not discuss permissions or concurrency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first sentence, followed by the refusal semantics and then the storage-failure semantics in a logical order. The second sentence is long and dense with parenthetical error codes, but nearly every clause carries operational meaning, so little is 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 two-parameter tool with an output schema already covering return shape, the description supplies the one thing the schema cannot: what it means when deletion fails and how to recover. Nothing an agent needs to invoke this correctly or interpret its errors 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 description coverage is 100%, so mediaId and organizationId are already documented, including the important multi-org rule. The description adds no parameter-level detail of its own, which is acceptable given the schema but caps this dimension at the baseline.

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 sentence gives a specific verb plus resource ('Permanently delete a media file from the library') and the word 'permanently' distinguishes this from the recoverable mutations offered by siblings such as update_media or archive_post. An agent immediately knows this is an irreversible removal of a media asset, not a post or template operation.

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 explicitly routes the agent: if the file is in use it names the alternatives (update_post / update_template to detach, archive_post / delete_template to remove the dependent resource) and states the condition that triggers each path. It also gives a retry instruction for the 502 case, so both the happy path and the failure path are actionable.

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