delete_by_query
Delete documents matching a query from an Elasticsearch index. Requires confirmation, refuses match-all to prevent accidental full-index wipe, runs asynchronously, and returns a task ID for polling.
Instructions
Delete documents matching a query from an index. DESTRUCTIVE and irreversible. A query is mandatory: match_all is refused so you cannot wipe an index by accident. Runs asynchronously (wait_for_completion=false) and returns a task_id to poll with get_task. Reports how many documents match before deleting. Requires writes enabled, ES_MCP_ALLOW_DESTRUCTIVE=true, and confirm=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | ||
| query | Yes | ||
| slices | No | auto | |
| confirm | No | ||
| requests_per_second | No | ||
| wait_for_completion | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |