Skip to main content
Glama
cr7258

Elasticsearch MCP Server

put_alias

Create or update an alias for an Elasticsearch index to simplify index management and reference documents.

Instructions

        Create or update an alias for a specific index.

        Args:
            index: Name of the index
            name: Name of the alias
            body: Alias configuration
        

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes
nameYes
bodyYes

Implementation Reference

  • MCP tool handler function for 'put_alias'. Registers the tool and implements the logic by delegating to the search client's put_alias method. The docstring provides input schema.
    @mcp.tool()
    def put_alias(index: str, name: str, body: Dict) -> Dict:
        """
        Create or update an alias for a specific index.
    
        Args:
            index: Name of the index
            name: Name of the alias
            body: Alias configuration
        """
        return self.search_client.put_alias(index=index, name=name, body=body)
  • The underlying client method that performs the actual Elasticsearch/OpenSearch put_alias API call.
    def put_alias(self, index: str, name: str, body: Dict) -> Dict:
        """Creates or updates an alias."""
        return self.client.indices.put_alias(index=index, name=name, body=body)
  • src/server.py:44-53 (registration)
    Registration of AliasTools class in the main server, which leads to instantiation and calling register_tools to define and register the put_alias tool.
    tool_classes = [
        IndexTools,
        DocumentTools,
        ClusterTools,
        AliasTools,
        DataStreamTools,
        GeneralTools,
    ]        
    # Register all tools
    register.register_all_tools(tool_classes)
  • Instantiation of AliasTools with search_client and preparation for registration, including risk management setup.
    for tool_class in tool_classes:
        self.logger.info(f"Registering tools from {tool_class.__name__}")
        tool_instance = tool_class(self.search_client)
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 'Create or update' which implies mutation, but doesn't specify permissions needed, whether changes are reversible, rate limits, or what happens on conflicts. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 brief and front-loaded with the core purpose in the first sentence. The parameter list is formatted clearly but could be more integrated. There's no wasted text, though it might benefit from slightly more elaboration given the lack of annotations and schema descriptions.

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 (mutation with 3 parameters, nested 'body' object, no output schema, and no annotations), the description is incomplete. It doesn't cover behavioral aspects like side effects, error conditions, or return values, and parameter details are sparse. This leaves the agent under-informed for safe and effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the schema provides no parameter descriptions. The description lists parameter names ('index', 'name', 'body') but adds minimal semantics: it clarifies 'body' is 'Alias configuration', which is helpful but vague. It doesn't explain what values are expected for 'index' or 'name', or detail the structure of 'body', leaving most parameter meaning undocumented.

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 verb ('Create or update') and resource ('an alias for a specific index'), making the purpose explicit. However, it doesn't distinguish this tool from its sibling 'get_alias' or 'list_aliases', which would require mentioning it's a write operation versus read operations.

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 'delete_alias' or 'list_aliases'. It doesn't mention prerequisites, such as whether the index must exist, or when to choose creation versus update, leaving the agent without contextual usage cues.

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