Skip to main content
Glama
cr7258

Elasticsearch MCP Server

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
NameRequiredDescriptionDefault
indexYes
idYes

Implementation Reference

  • 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)
  • 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)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cr7258/elasticsearch-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server