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
    """
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a 'Get' operation, implying it's likely read-only and non-destructive, but doesn't confirm this or describe other behaviors like error handling, authentication needs, rate limits, or what 'alias information' includes (e.g., metadata, configuration). This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the purpose stated clearly in the first sentence and parameter details following. There's no wasted text, though the structure is simple and could benefit from more explicit separation of sections.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (a read operation with one parameter), no annotations, and no output schema, the description is incomplete. It doesn't explain what 'alias information' returns, potential errors, or how this fits with sibling tools, leaving the agent with insufficient context to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It adds meaning by explaining that 'index' is the 'Name of the index', which clarifies the parameter's purpose beyond the schema's generic 'string' type. However, it doesn't provide examples, constraints, or format details, offering only basic semantic context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get alias information') and the target resource ('for a specific index'), which is a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling 'list_aliases' or 'put_alias', which reduces the score from a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_aliases' (which might list all aliases) or 'put_alias' (which creates/modifies aliases). There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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