delete_document
Remove a document from an Elasticsearch index by specifying its ID and index name to manage data storage.
Instructions
Delete a document by ID.
Args:
index: Name of the index
id: Document ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | ||
| id | Yes |
Implementation Reference
- src/tools/document.py:44-54 (handler)The FastMCP tool handler for delete_document, which delegates to the search_client's delete_document method.@mcp.tool() def delete_document(index: str, id: str) -> Dict: """ Delete a document by ID. Args: index: Name of the index id: Document ID """ return self.search_client.delete_document(index=index, id=id)
- src/clients/common/document.py:30-32 (helper)Low-level DocumentClient method implementing document deletion via the underlying search client (Elasticsearch/OpenSearch).def delete_document(self, index: str, id: str) -> Dict: """Removes a document from the index.""" return self.client.delete(index=index, id=id)