Skip to main content
Glama

delete_items

Destructive

Permanently deletes items from a Directus collection using explicit IDs or a query, requiring confirm: true. IDs and query are mutually exclusive, and passing neither deletes nothing.

Instructions

Deletes items from a collection, by explicit ids or by a Directus query, permanently. Requires confirm: true, and passing neither ids nor query deletes nothing. ids and query are mutually exclusive. Since Directus 12.4 a query resolves its targets under the read permissions of the token: read access to the primary key is required and only readable items are deleted, so the deleted count can be lower than the matching count. Use { "limit": -1 } in query to deliberately target every item. cascadeDelete also removes related items and works only with ids. Use delete_collection to drop the whole collection instead.

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": {
      "collection": "<collection>"
    },
    "name": "delete_items"
  }
}

Input Schema

NameRequiredDescriptionDefault
idsNoExplicit item IDs to delete
queryNoDirectus query selecting the items to delete, e.g. { "filter": { "status": { "_eq": "archived" } } }. Mutually exclusive with ids. Use { "limit": -1 } to deliberately target every item.
confirmNoConfirm deletion
collectionYesCollection name
cascadeDeleteNoDelete related items (requires ids)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv12.3.3

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint and openWorldHint, yet the description adds substantial behavior beyond them: permanence of the delete, the confirm gate, token-read-permission scoping since Directus 12.4 (read access to primary key required, only readable items deleted, count can fall short of matching count), the { limit: -1 } targeting trick, and that cascadeDelete requires ids.

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?

A single dense paragraph, front-loaded with the destructive action and the confirm requirement, then ordered by targeting mode and edge cases. Every sentence carries a distinct constraint; no filler or repetition.

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?

For a destructive, nested-object tool with no output schema, the description covers the important operational detail, including that the returned deleted count may be lower than the match count. Only the precise response shape is left unstated, which is a minor gap.

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 baseline is 3; the description still adds value the schema does not carry, notably that cascadeDelete works only with ids and the permission-based resolution semantics of query. The mutual-exclusivity and limit: -1 points largely restate schema descriptions, keeping it below a 5.

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 a specific verb+resource ('Deletes items from a collection') and immediately narrows scope to the two targeting modes (explicit ids or a Directus query). It also explicitly distinguishes itself from the sibling delete_collection, so an agent can route without opening either schema.

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 concrete when-to-use guidance: requires confirm: true, states that passing neither ids nor query deletes nothing, declares ids and query mutually exclusive, and routes whole-collection deletion to delete_collection. Alternatives and edge conditions are explicit rather than inferred.

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