Skip to main content
Glama
seohyunjun

OpenSearch MCP Server

by seohyunjun

get_settings

Retrieve configuration settings for a specific OpenSearch index to understand its structure and behavior.

Instructions

Get index settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes

Implementation Reference

  • The get_settings tool handler: decorated with @mcp.tool for registration and implements the logic to retrieve OpenSearch index settings using the client, handling errors.
    @mcp.tool(description="Get index settings")
    async def get_settings(index: str) -> list[TextContent]:
        """
        Get the settings for an index.
        
        Args:
            index: Name of the index
        """
        self.logger.info(f"Getting settings for index: {index}")
        try:
            response = self.es_client.indices.get_settings(index=index, h=["index", "health"])
            return [TextContent(type="text", text=str(response))]
        except Exception as e:
            self.logger.error(f"Error getting settings: {e}")
            return [TextContent(type="text", text=f"Error: {str(e)}")]
  • Invocation of register_tools on IndexTools instance, which defines and registers the get_settings tool among others.
    index_tools.register_tools(self.mcp)

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/seohyunjun/opensearch-mcp-server'

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