Skip to main content
Glama

bulk_delete_assets

Destructive

Batch-delete Unreal Engine assets with per-item refusal gates for read-only roots, protected paths, open worlds, and zero referencers. Dry run defaults to true for safety.

Instructions

GUARDED batch asset deletion. dry_run DEFAULTS TO TRUE (deliberate: it is the most destructive command in the plugin, bulk_delete_assets(["/Game/VendorPack"], recursive=true) would be a valid unconfirmed call, and agent allowlists may run mutating tools with no prompt). Four independent gates REFUSE per item instead of skipping silently: readonly_roots (default: the project's Read Only Content Roots), protect_paths (wildcards -- the only gate that saves a zero-referencer asset), the currently-open editor world, and the OPT-IN require_zero_referencers gate whose referencer count EXCLUDES referencers that are themselves in this batch (so a self-contained dead subgraph can still be deleted whole). Deletion is a single ObjectTools::ForceDeleteObjects over the whole eligible batch -- resolving each object here via StaticFindObject/StaticLoadObject rather than through UEditorAssetSubsystem::DeleteAsset, whose UE::EditorAssetUtils::LoadAssetFromPath/EnsureAssetsLoaded preamble is a known crash site ("Array index out of bounds", deterministic on corrupted leftovers). deleted_count counts ONLY items that passed BOTH post-delete probes -- the package file is gone (FPackageName::DoesPackageExist) AND the object no longer resolves at its original path (StaticFindObject) -- never the API's own return value. Both are required because for a never-saved, registry-visible asset the disk probe is vacuously true (it was never on disk), so residency is the only real evidence; each failure names which probe still sees the item.

Returns: { requested_count, expanded_count, recursive, dry_run, readonly_roots: [string], protect_paths: [string], require_zero_referencers: bool, dependency_type: string, expanded_folders: [{folder, asset_count}], eligible_count, would_delete: [{path, package_name, external_referencer_count, external_referencers: [string], on_disk}], deleted: [{path, package_name, deleted, still_loaded, error?}], deleted_count, failed_count, force_delete_reported_count, refused_readonly_root: [{path, matched_root}], refused_protected: [{path, matched_pattern}], refused_referenced: [{path, external_referencer_count, external_referencers: [string]}], refused_open_world: [{path, reason}], refused_count, results: [{path, success, error}], note, verification: {...} }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dry_runNoDefault TRUE. Nothing is deleted; would_delete reports what WOULD go, with each item's gate verdict. Pass false to actually delete.
recursiveNoIf true, expand folder paths to all contained assets. Default false.
asset_pathsYesList of asset paths (or folder paths when recursive is true). Required, non-empty.
protect_pathsNoWildcard patterns (FString::MatchesWildcard, case-insensitive, `*` spans '/') matched against both the package name and the object path. Default [] (gate off). Matches are REFUSED (refused_protected).
readonly_rootsNoContent roots that may never be deleted from. Default: the project's Read Only Content Roots; pass [] to disable the gate entirely. Matches are REFUSED (refused_readonly_root), never silently skipped. (Read via mcp_common::ParseReadonlyRoots, so the type is declared here.)
dependency_typeNoReferencer filter for the count above: "hard"|"soft"|"all" (case-insensitive), default "all".
require_zero_referencersNoDefault FALSE. When true, an asset with at least one referencer OUTSIDE this batch is refused. The per-item external_referencer_count is reported either way.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Despite annotations already declaring destructiveHint=true and readOnlyHint=false, the description goes far beyond them: it names the four independent gates, explains per-item refusal instead of silent skip, documents the ForceDeleteObjects-vs-DeleteAsset crash rationale, and clarifies that deleted_count reflects post-delete probes rather than the API return value. This is unusually rich behavioral disclosure.

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 and the critical dry_run default are front-loaded, and most sentences carry necessary safety context for a destructive tool. It is dense and long, with some implementation tangents (StaticFindObject/StaticLoadObject, the specific crash string), but for a destructive batch tool the length is largely earned.

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?

There is no output schema, yet the description supplies a full return-shape block listing every field (would_delete, deleted, refused_* arrays, counts, verification, note). Combined with the gate semantics and dry_run behavior, an agent has everything needed to invoke and interpret results correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the structural baseline is 3, but the description adds cross-parameter meaning the schema cannot: how the require_zero_referencers gate excludes in-batch referencers, how protect_paths is the only gate that saves a zero-referencer asset, and the rationale for the dry_run default. This genuinely enriches parameter interpretation.

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?

Opens with 'GUARDED batch asset deletion' – a specific verb (delete), resource (assets), and scope (batch) that the agent can distinguish from single-item siblings like delete_asset or batch_delete_actors. The guarded/gated nature is also stated up front, so the tool's identity is unambiguous.

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?

Explains the operative conditions well: dry_run defaults to TRUE, pass false to actually delete, and the four gates define exactly when items are refused. It does not, however, explicitly contrast itself against the sibling delete_asset for single-item work, so the when-to-prefer-this routing is left implicit.

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