Skip to main content
Glama
seohyunjun

OpenSearch MCP Server

by seohyunjun

list_index_patterns

Retrieve OpenSearch Dashboards index patterns to organize and access data across your OpenSearch cluster for efficient data management.

Instructions

List OpenSearch Dashboards index patterns2

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'list_index_patterns' tool. It searches the '.kibana' index for 'index-pattern' objects and returns a JSON list of their titles and IDs, or an error message.
    @mcp.tool(description="List OpenSearch Dashboards index patterns2")
    async def list_index_patterns() -> list[TextContent]:
        """
        Find all index pattern IDs stored in the .kibana index. Especially useful for
        identifying the correct index pattern ID to use in the Discover view URL.
        This function queries the .kibana index for saved objects of type 'index-pattern'
        and returns a list of their titles and IDs.
    
        Returns:
        list[TextContent]: A list containing the found index patterns or an error message.
        """
        self.logger.info("Searching for index patterns")
        try:
            response = self.es_client.search(
                index=".kibana",
                body={
                    '_source': ['index-pattern.title', '_id'],
                    'query': {
                        'term': {
                            'type': 'index-pattern'
                        }
                    }
                }
            )
            patterns = json.dumps([{hit["_source"]["index-pattern"]["title"]: hit["_id"].replace('index-pattern:', '')} 
                        for hit in response["hits"]["hits"]], indent=4)
            return [TextContent(type="text", text=(patterns))]
        except Exception as e:
            self.logger.error(f"Error finding index patterns: {e}")
            return [TextContent(type="text", text=f"Error: {(e)}")]
  • Registration call for DashboardTools in the main server, which registers the list_index_patterns tool among others.
    dashboard_tools.register_tools(self.mcp)
  • Instantiation of DashboardTools class, prerequisite for registering its tools including list_index_patterns.
    dashboard_tools = DashboardTools(self.logger)
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 the action but doesn't describe what 'list' entails—such as whether it returns all patterns, supports pagination, requires permissions, or has rate limits. This is a significant gap for a tool with zero annotation coverage.

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 waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word contributes directly to stating the tool's purpose.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., format, structure of index patterns) or behavioral aspects like error handling. For a tool in a complex domain like OpenSearch, more context is needed to guide effective use.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, which is appropriate here, but it also doesn't compensate for any gaps since there are none. A baseline of 4 is given as it meets the minimal requirement for a parameterless tool.

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 ('List') and resource ('OpenSearch Dashboards index patterns'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'list_indices' or 'get_index_templates', which might have overlapping functionality in the same domain.

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?

No guidance is provided on when to use this tool versus alternatives like 'list_indices' or 'get_index_templates'. The description lacks context about specific use cases, prerequisites, or exclusions, leaving the agent to infer usage from the tool name alone.

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