get_settings
Retrieve configuration settings for a specific OpenSearch index to understand its structure and behavior.
Instructions
Get index settings
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"index": "<index>"
},
"name": "get_settings"
}
}Input 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)