Skip to main content
Glama
seohyunjun

OpenSearch MCP Server

by seohyunjun

get_ism_policies

Retrieve Index State Management policies and their configurations from OpenSearch clusters to manage data lifecycle and automate index operations.

Instructions

Get ISM policies and their configurations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the get_ism_policies tool. It is a nested async function decorated with @mcp.tool inside the register_tools method. Fetches ISM policies from OpenSearch endpoint '/_plugins/_ism/policies' and returns as list of TextContent.
    @mcp.tool(description="Get ISM policies and their configurations") async def get_ism_policies() -> list[TextContent]: """ Get Index State Management policies and their configurations. Returns policy IDs, descriptions, states, and index patterns. This result should be useful in determining index lifecycle management configurations such as index size limits, index rollover policy and retention policy. """ self.logger.info("Fetching ISM policies...") try: response = self.es_client.transport.perform_request( 'GET', '/_plugins/_ism/policies', params={'filter_path': 'policies.policy.policy_id,policies.policy.description,policies.policy.states,policies.policy.ism_template.index_patterns'} ) return [TextContent(type="text", text=str(response))] except Exception as e: self.logger.error(f"Error fetching ISM policies: {e}") return [TextContent(type="text", text=f"Error: {str(e)}")]
  • Invocation of register_tools on the AdminIndexTools instance in the main server, which triggers the registration of the get_ism_policies tool (and other admin index tools).
    admin_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