get_alias
Retrieve alias information for a specific Elasticsearch index to understand index mappings 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 handler function for the MCP tool named 'get_alias'. It is decorated with @mcp.tool() and delegates the call to the search client's get_alias method, which performs the actual API call.@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/clients/common/alias.py:10-12 (helper)Helper method in AliasClient that implements the core logic of retrieving aliases using the underlying Elasticsearch/OpenSearch client's indices.get_alias API.def get_alias(self, index: str) -> Dict: """Get aliases for the specified index.""" return self.client.indices.get_alias(index=index)
- src/server.py:44-53 (registration)Top-level registration where AliasTools (containing the get_alias tool) is included in the tool_classes list and registered via ToolsRegister.register_all_tools.tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ] # Register all tools register.register_all_tools(tool_classes)
- src/tools/alias.py:16-21 (schema)Docstring providing input schema description (index: str) and purpose; used by FastMCP for tool schema generation along with type hints.""" Get alias information for a specific index. Args: index: Name of the index """