Skip to main content
Glama
cr7258

Elasticsearch MCP Server

search_documents

Query and retrieve documents from Elasticsearch clusters by specifying an index and search query using the MCP server for precise and scalable information retrieval.

Instructions

Search for documents. Args: index: Name of the index body: Search query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bodyYes
indexYes

Implementation Reference

  • The FastMCP tool handler for 'search_documents', decorated with @mcp.tool(), including input schema via type hints and docstring, and logic delegating to search_client.
    @mcp.tool() def search_documents(index: str, body: Dict) -> Dict: """ Search for documents. Args: index: Name of the index body: Search query """ return self.search_client.search_documents(index=index, body=body)
  • src/server.py:44-53 (registration)
    Top-level registration where DocumentTools (containing search_documents tool) is included in tool_classes list and registered via ToolsRegister.register_all_tools.
    tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ] # Register all tools register.register_all_tools(tool_classes)
  • Underlying helper method in DocumentClient that implements the document search logic by calling self.client.search (the engine client).
    def search_documents(self, index: str, body: Dict) -> Dict: """Search for documents in the index.""" return self.client.search(index=index, body=body)

Other Tools

Related 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/cr7258/elasticsearch-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server