delete_items
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
| Name | Required | Description | Default |
|---|---|---|---|
| ids | No | Explicit item IDs to delete | |
| query | No | Directus query selecting the items to delete, e.g. { "filter": { "status": { "_eq": "archived" } } }. Mutually exclusive with ids. Use { "limit": -1 } to deliberately target every item. | |
| confirm | No | Confirm deletion | |
| collection | Yes | Collection name | |
| cascadeDelete | No | Delete related items (requires ids) |