Skip to main content
Glama
cr7258

Elasticsearch MCP Server

get_document

Retrieve a specific document by its ID and index from Elasticsearch clusters. Ideal for targeted data extraction and document access in Elasticsearch environments.

Instructions

Get a document by ID. Args: index: Name of the index id: Document ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
indexYes

Implementation Reference

  • MCP tool handler for 'get_document'. Decorated with @mcp.tool(), delegates to search_client.get_document.
    @mcp.tool() def get_document(index: str, id: str) -> Dict: """ Get a document by ID. Args: index: Name of the index id: Document ID """ return self.search_client.get_document(index=index, id=id)
  • Underlying implementation in DocumentClient that calls the search client.get method.
    def get_document(self, index: str, id: str) -> Dict: """Get a document by ID.""" return self.client.get(index=index, id=id)
  • src/server.py:44-53 (registration)
    Registration point where DocumentTools class is included in the list of tools to register via ToolsRegister.register_all_tools.
    tool_classes = [ IndexTools, DocumentTools, ClusterTools, AliasTools, DataStreamTools, GeneralTools, ] # Register all tools register.register_all_tools(tool_classes)

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