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
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes |
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)}")]
- src/opensearch_mcp_server/server.py:36-36 (registration)Registration call for IndexTools instance, which registers the 'get_settings' tool (and others) to the MCP server.index_tools.register_tools(self.mcp)
- src/opensearch_mcp_server/server.py:28-28 (registration)Instantiation of IndexTools class, prerequisite for registering its tools including 'get_settings'.index_tools = IndexTools(self.logger)