es-info
Retrieve Elasticsearch cluster information and configuration details from the MCP server for monitoring and troubleshooting database operations.
Instructions
Get Elasticsearch info
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| req | Yes |
Implementation Reference
- Handler function for the 'es-info' tool. Calls self.es_client.info() to retrieve Elasticsearch cluster information and returns it wrapped in a success dict or error on failure.def _handle_info(self, req: Dict[str, Any]) -> Dict[str, Any]: """Get Elasticsearch cluster info.""" try: info = self.es_client.info() return {"success": True, "info": info} except Exception as e: self.logger.error(f"Error getting Elasticsearch info: {str(e)}") return {"success": False, "error": str(e)}
- src/elasticsearch7_mcp_server/server.py:32-32 (registration)Registration of the 'es-info' tool using FastMCP's tool decorator, linking it to the _handle_info handler function.self.server.tool(name="es-info", description="Get Elasticsearch info")(self._handle_info)