test_connection
Verify connectivity and check server status for the EVE-NG network emulation platform to ensure proper communication before managing network topologies.
Instructions
Test connection to EVE-NG server.
This tool verifies that the connection to the EVE-NG server is working
properly and returns server status information.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arguments | Yes |
Implementation Reference
- The main handler function for the 'test_connection' MCP tool. It checks if connected to EVE-NG, fetches server status, and returns success or failure message.@mcp.tool() async def test_connection(arguments: TestConnectionArgs) -> list[TextContent]: """ Test connection to EVE-NG server. This tool verifies that the connection to the EVE-NG server is working properly and returns server status information. """ try: logger.info("Testing EVE-NG server connection") if not eveng_client.is_connected: return [TextContent( type="text", text="Not connected to EVE-NG server. Use connect_eveng_server tool first." )] # Test connection by getting server status status = await eveng_client.get_server_status() return [TextContent( type="text", text=f"Connection test successful!\n\n" f"Server: {eveng_client.config.eveng.base_url}\n" f"Status: Connected\n" f"Server Version: {status.get('version', 'Unknown')}\n" f"Server Status: {status.get('status', 'Unknown')}\n" f"Uptime: {status.get('uptime', 'Unknown')}" )] except Exception as e: logger.error(f"Connection test failed: {e}") return [TextContent( type="text", text=f"Connection test failed: {str(e)}\n\n" f"Please check your connection and try again." )]
- Pydantic schema/model for the input arguments of the test_connection tool (no required arguments).class TestConnectionArgs(BaseModel): """Arguments for test_connection tool.""" pass # No arguments needed
- eveng_mcp_server/tools/__init__.py:15-28 (registration)Registration function that calls register_connection_tools (among others), which registers the test_connection tool.def register_tools(mcp: "FastMCP", eveng_client: "EVENGClientWrapper") -> None: """Register all MCP tools.""" # Connection management tools register_connection_tools(mcp, eveng_client) # Lab management tools register_lab_tools(mcp, eveng_client) # Node management tools register_node_tools(mcp, eveng_client) # Network management tools register_network_tools(mcp, eveng_client)
- eveng_mcp_server/server.py:52-54 (registration)Where the tools registration is invoked in the main server setup.# Register tools register_tools(self.mcp, self.eveng_client)