get_alias
Retrieve alias details for a specified index in Elasticsearch clusters using the MCP server, enabling efficient management of index operations and configurations.
Instructions
Get alias information for a specific index.
Args:
index: Name of the index
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes |
Implementation Reference
- src/tools/alias.py:14-22 (handler)The main handler function for the 'get_alias' MCP tool. It takes an index name and returns the alias information by delegating to the search client.@mcp.tool() def get_alias(index: str) -> Dict: """ Get alias information for a specific index. Args: index: Name of the index """ return self.search_client.get_alias(index=index)
- src/server.py:44-53 (registration)The AliasTools class, which contains the get_alias tool, is included in the list of tool classes registered via ToolsRegister in the MCP server initialization.tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ] # Register all tools register.register_all_tools(tool_classes)
- src/clients/common/alias.py:10-12 (helper)Helper method in AliasClient that implements the actual API call to retrieve aliases for an index, called by the tool handler.def get_alias(self, index: str) -> Dict: """Get aliases for the specified index.""" return self.client.indices.get_alias(index=index)