delete_index
Remove an Elasticsearch index to free storage space and manage cluster resources by specifying the index name.
Instructions
Delete an index.
Args:
index: Name of the index
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes |
Implementation Reference
- src/tools/index.py:36-44 (handler)The MCP tool handler function for 'delete_index'. It is decorated with @mcp.tool() and delegates the deletion to the underlying search client.@mcp.tool() def delete_index(index: str) -> Dict: """ Delete an index. Args: index: Name of the index """ return self.search_client.delete_index(index=index)
- src/clients/common/index.py:18-20 (helper)The underlying client method implementation that performs the actual index deletion using the Elasticsearch/OpenSearch client.def delete_index(self, index: str) -> Dict: """Delete an index.""" return self.client.indices.delete(index=index)
- src/server.py:41-53 (registration)Registration of IndexTools (containing delete_index) via ToolsRegister.register_all_tools during server initialization.register = ToolsRegister(self.logger, self.search_client, self.mcp) # Define all tool classes to register tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ] # Register all tools register.register_all_tools(tool_classes)
- src/risk_config.py:10-14 (helper)Configuration marking 'delete_index' as a high-risk operation for IndexTools, which can conditionally disable its registration.HIGH_RISK_OPERATIONS = { "IndexTools": { "create_index", "delete_index", },