Skip to main content
Glama
seohyunjun

OpenSearch MCP Server

by seohyunjun

list_indices

Retrieve a list of all indices in your OpenSearch cluster to manage data organization and monitor storage.

Instructions

List all indices in the Opensearch cluster

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async handler function that implements the logic for the 'list_indices' MCP tool. It queries the OpenSearch cluster for indices and returns them as TextContent.
    @mcp.tool(description="List all indices in the Opensearch cluster") async def list_indices() -> list[TextContent]: """ List all indices in the Opensearch cluster. It is important to check the indices before searching documents to understand what indices are avilable. """ self.logger.info("Listing indices...") try: indices = self.es_client.cat.indices(format="json") return [TextContent(type="text", text=str(indices))] except Exception as e: self.logger.error(f"Error listing indices: {e}") return [TextContent(type="text", text=f"Error: {str(e)}")]
  • The point where IndexTools.register_tools is called to register the list_indices tool (among others) with the MCP server.
    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