Skip to main content
Glama
cr7258

Elasticsearch MCP Server

delete_by_query

Remove documents from an Elasticsearch index that match a specified query. Provide the index name and query criteria to execute the deletion process efficiently.

Instructions

Deletes documents matching the provided query. Args: index: Name of the index body: Query to match documents for deletion

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
indexYes

Implementation Reference

  • MCP tool handler for 'delete_by_query'. This decorated function defines the tool implementation, including input parameters, description, and logic that delegates to the search client's delete_by_query method.
    @mcp.tool() def delete_by_query(index: str, body: Dict) -> Dict: """ Deletes documents matching the provided query. Args: index: Name of the index body: Query to match documents for deletion """ return self.search_client.delete_by_query(index=index, body=body)
  • Helper method in DocumentClient that wraps the underlying search engine client's delete_by_query operation.
    def delete_by_query(self, index: str, body: Dict) -> Dict: """Deletes documents matching the provided query.""" return self.client.delete_by_query(index=index, body=body)

Other Tools

Related Tools

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