Skip to main content
Glama
cr7258

Elasticsearch MCP Server

put_alias

Create or update an alias for a specific index in Elasticsearch clusters using the MCP server, enabling efficient index management with targeted configurations.

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
bodyYes
indexYes
nameYes

Implementation Reference

  • The primary MCP tool handler for 'put_alias'. This decorated function defines the tool logic, input parameters via type hints, documentation, and delegates execution to the search client's put_alias method.
    @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)
  • Supporting client method in AliasClient that implements the put_alias operation by calling the underlying Elasticsearch/OpenSearch client's indices.put_alias API.
    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-51 (registration)
    Server registration code where AliasTools class (containing put_alias) is included in the list of tool classes instantiated and registered via ToolsRegister.
    tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ]

Other Tools

Related 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