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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states what the tool does but doesn't describe how it behaves: no information about permissions required, rate limits, pagination, error handling, or what 'configurations' includes. For a read operation with zero annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple retrieval tool with no parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema), the description is minimally complete for understanding what it retrieves. However, with no annotations and no output schema, it lacks details about behavioral traits and return format, leaving gaps for the agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description adds no parameter information, which is appropriate since there are none. The baseline for 0 parameters is 4, as no compensation is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('ISM policies and their configurations'), making the purpose immediately understandable. However, it doesn't differentiate this tool from potential sibling tools that might also retrieve policy information, as none of the listed siblings appear to directly overlap with ISM policies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for use, or how it differs from other data retrieval tools in the sibling list (e.g., get_settings, get_index_templates). This leaves the agent without usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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