Skip to main content
Glama
Akhilvis

Elastic MCP

by Akhilvis

get_index_mappings

Retrieve the field mappings and data structure definitions for a specified Elasticsearch index to understand its schema and data organization.

Instructions

Get the mappings of a specific Elasticsearch index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes

Implementation Reference

  • The handler function for the 'get_index_mappings' tool, decorated with @mcp.tool(). It retrieves the mappings for a specified Elasticsearch index using es.indices.get_mapping() and returns them or an error dictionary.
    @mcp.tool()
    def get_index_mappings(index: str) -> dict:
        """Get the mappings of a specific Elasticsearch index."""
        try:
            mappings = es.indices.get_mapping(index=index)
            return mappings.get(index, {})
        except Exception as e:
            logger.error(f"Error getting mappings for index '{index}': {e}")
            return {"error": str(e)}
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. While 'Get' implies a read operation, the description doesn't address important behavioral aspects like authentication requirements, rate limits, error conditions, response format, or whether this operation has any side effects. For a tool with zero annotation coverage, this represents a significant gap in behavioral transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It's appropriately sized for a simple tool and front-loads the essential information. Every word earns its place in this concise formulation.

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?

For a tool with no annotations, no output schema, and minimal parameter documentation, the description is insufficiently complete. While the purpose is clear, the description doesn't address what 'mappings' are, what format they're returned in, authentication requirements, or error handling. Given the complexity of Elasticsearch operations and the lack of structured documentation, more context would be helpful.

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 mentions 'a specific Elasticsearch index' which provides context for the single 'index' parameter, but with 0% schema description coverage, the schema provides no parameter documentation. The description adds some semantic meaning (it's an Elasticsearch index name) but doesn't specify format requirements, constraints, or examples. This partially compensates for the schema gap but not fully.

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 action ('Get') and resource ('mappings of a specific Elasticsearch index'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_indices' or 'search_index' - it's clear this retrieves mappings rather than listing indices or searching content, but no direct comparison is provided.

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. There's no mention of when this tool is appropriate versus 'list_indices' or 'search_index', nor any prerequisites or constraints for its use. The agent receives no contextual guidance about appropriate usage scenarios.

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/Akhilvis/elastic-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server