Skip to main content
Glama
cr7258

Elasticsearch MCP Server

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

Implementation Reference

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

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