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
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes |
Implementation Reference
- src/tools/index.py:15-23 (handler)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)
- src/clients/common/index.py:10-12 (helper)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)