es-ping
Check connectivity and verify the Elasticsearch 7.x server is responsive. Use this tool to test server availability before performing search operations.
Instructions
Ping Elasticsearch server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| req | Yes |
Implementation Reference
- src/elasticsearch7_mcp_server/server.py:31-31 (registration)Registration of the 'es-ping' tool, binding it to the _handle_ping method.self.server.tool(name="es-ping", description="Ping Elasticsearch server")(self._handle_ping)
- The main handler function for the es-ping tool. It calls ping() on the Elasticsearch client and returns the success status or an error message.def _handle_ping(self, req: Dict[str, Any]) -> Dict[str, Any]: """Handle ping request to Elasticsearch.""" try: result = self.es_client.ping() return {"success": result} except Exception as e: self.logger.error(f"Error pinging Elasticsearch: {str(e)}") return {"success": False, "error": str(e)}