get_settings
Retrieve configuration settings for a specific OpenSearch index to understand its structure and behavior.
Instructions
Get index settings
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes |
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)}")]
- src/opensearch_mcp_server/server.py:36-36 (registration)Invocation of register_tools on IndexTools instance, which defines and registers the get_settings tool among others.index_tools.register_tools(self.mcp)