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)}

Tool Definition Quality

Score is being calculated. Check back soon.

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