Skip to main content
Glama
cr7258

Elasticsearch MCP Server

get_index

Retrieve index metadata including mappings, settings, and aliases from Elasticsearch clusters to understand data structure and configuration.

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

  • MCP tool handler for 'get_index'. Decorated with @mcp.tool(), it takes an index name and delegates to the search_client's get_index method to retrieve index information.
    @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)
  • IndexTools.register_tools method registers all index-related MCP tools, including 'get_index', by defining them with @mcp.tool() decorators.
    def register_tools(self, mcp: FastMCP):
        @mcp.tool()
        def list_indices() -> List[Dict]:
            """List all indices."""
            return self.search_client.list_indices()
    
        @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)
    
        @mcp.tool()
        def create_index(index: str, body: Optional[Dict] = None) -> Dict:
            """
            Create a new index.
            
            Args:
                index: Name of the index
                body: Optional index configuration including mappings and settings
            """
            return self.search_client.create_index(index=index, body=body)
    
        @mcp.tool()
        def delete_index(index: str) -> Dict:
            """
            Delete an index.
            
            Args:
                index: Name of the index
            """
            return self.search_client.delete_index(index=index)
  • Helper method in IndexClient that implements the core logic for retrieving index information by calling the underlying client's indices.get() method.
    def get_index(self, index: str) -> Dict:
        """Returns information (mappings, settings, aliases) about one or more indices."""
        return self.client.indices.get(index=index)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a read operation ('Returns information'), implying it's non-destructive, but doesn't cover other aspects like authentication needs, rate limits, error handling, or response format. For a 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 concise and well-structured, with a clear purpose statement followed by an Args section. It uses two sentences effectively without waste. However, the formatting includes extra whitespace, and it could be more front-loaded by integrating the parameter info more seamlessly, preventing a perfect score.

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 complexity (a read operation with one parameter) and lack of annotations and output schema, the description is incomplete. It covers the basic purpose and parameter but misses behavioral details like response format, error cases, or usage context. For a tool in this environment, more information is needed to ensure the agent can use it correctly without guesswork.

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 description adds minimal semantics beyond the input schema. It documents the 'index' parameter in the Args section, but with 0% schema description coverage, the schema provides no details about this parameter. The description only states 'Name of the index', which is basic and doesn't explain format, constraints, or examples. This partially compensates but leaves gaps, aligning with the baseline for low coverage.

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 tool's purpose: 'Returns information (mappings, settings, aliases) about one or more indices.' It specifies the verb ('Returns information') and resource ('indices'), and details the types of information returned. However, it doesn't explicitly differentiate from sibling tools like 'list_indices' or 'get_document', which would be needed for a score of 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. It doesn't mention sibling tools like 'list_indices' (which might list indices without details) or 'get_document' (which retrieves specific documents), nor does it specify prerequisites or exclusions. This lack of context leaves the agent to infer usage from the purpose 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