Skip to main content
Glama
cr7258

Elasticsearch MCP Server

get_index

Retrieve details such as mappings, settings, and aliases for specific indices in Elasticsearch.

Instructions

Returns information (mappings, settings, aliases) about one or more indices. Args: index: Name of the index

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes

Implementation Reference

  • The FastMCP tool handler for 'get_index'. Decorated with @mcp.tool(), it defines the input schema via type hints and docstring, and executes by delegating to the search client's get_index method.
    @mcp.tool() def get_index(index: str) -> Dict: """ Returns information (mappings, settings, aliases) about one or more indices. Args: index: Name of the index """ return self.search_client.get_index(index=index)
  • src/server.py:44-53 (registration)
    Registration of the IndexTools class (containing get_index) by including it in the tool_classes list and calling register_all_tools on ToolsRegister instance.
    tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ] # Register all tools register.register_all_tools(tool_classes)
  • Supporting client method in IndexClient that implements the actual retrieval of index information via the underlying search engine client API.
    def get_index(self, index: str) -> Dict: """Returns information (mappings, settings, aliases) about one or more indices.""" return self.client.indices.get(index=index)

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