Skip to main content
Glama
seohyunjun

OpenSearch MCP Server

by seohyunjun

get_settings

Retrieve index settings for OpenSearch clusters using natural language commands. Simplify cluster management by accessing configuration details for specific indices.

Instructions

Get index settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexYes

Implementation Reference

  • The handler function for the 'get_settings' tool. It takes an index name, fetches the settings from OpenSearch client, and returns the response as TextContent list.
    @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)}")]
  • Registration call for IndexTools instance, which registers the 'get_settings' tool (and others) to the MCP server.
    index_tools.register_tools(self.mcp)
  • Instantiation of IndexTools class, prerequisite for registering its tools including 'get_settings'.
    index_tools = IndexTools(self.logger)

Other Tools

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

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