get_node_details
Retrieve comprehensive configuration, status, and connectivity details for a specific node in EVE-NG network labs to analyze and manage network emulation environments.
Instructions
Get detailed information about a specific node.
This tool retrieves comprehensive information about a node including its configuration, status, interfaces, and connectivity.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| arguments | Yes |
Implementation Reference
- The main handler function for the 'get_node_details' MCP tool. It validates input, checks EVE-NG connection, retrieves node data via eveng_client.get_node(), formats comprehensive details (status, config, position, interfaces) into TextContent, handles errors.@mcp.tool() async def get_node_details(arguments: GetNodeDetailsArgs) -> list[TextContent]: """ Get detailed information about a specific node. This tool retrieves comprehensive information about a node including its configuration, status, interfaces, and connectivity. """ try: logger.info(f"Getting node details: {arguments.node_id} in {arguments.lab_path}") if not eveng_client.is_connected: return [TextContent( type="text", text="Not connected to EVE-NG server. Use connect_eveng_server tool first." )] # Get node details node = await eveng_client.get_node(arguments.lab_path, arguments.node_id) if not node.get('data'): return [TextContent( type="text", text=f"Node {arguments.node_id} not found in lab {arguments.lab_path}" )] node_data = node['data'] status_icon = "🟢" if node_data.get('status') == 2 else "🔴" if node_data.get('status') == 1 else "⚪" # Format node information details_text = f"Node Details: {node_data.get('name', f'Node {arguments.node_id}')}\n\n" details_text += f"{status_icon} Basic Information:\n" details_text += f" ID: {arguments.node_id}\n" details_text += f" Name: {node_data.get('name', 'Unknown')}\n" details_text += f" Template: {node_data.get('template', 'Unknown')}\n" details_text += f" Type: {node_data.get('type', 'Unknown')}\n" details_text += f" Image: {node_data.get('image', 'Unknown')}\n" details_text += f" Status: {_get_status_text(node_data.get('status', 0))}\n\n" details_text += f"⚙️ Configuration:\n" details_text += f" Console: {node_data.get('console', 'Unknown')}\n" details_text += f" CPU: {node_data.get('cpu', 'Unknown')}\n" details_text += f" RAM: {node_data.get('ram', 'Unknown')} MB\n" details_text += f" Ethernet Interfaces: {node_data.get('ethernet', 'Unknown')}\n" details_text += f" Serial Interfaces: {node_data.get('serial', 'Unknown')}\n" details_text += f" Delay: {node_data.get('delay', 0)} seconds\n\n" details_text += f"📍 Position:\n" details_text += f" Left: {node_data.get('left', 0)}%\n" details_text += f" Top: {node_data.get('top', 0)}%\n" return [TextContent( type="text", text=details_text )] except Exception as e: logger.error(f"Failed to get node details: {e}") return [TextContent( type="text", text=f"Failed to get node details: {str(e)}" )]
- Pydantic schema defining the input arguments for the get_node_details tool: lab_path (str) and node_id (str).class GetNodeDetailsArgs(BaseModel): """Arguments for get_node_details tool.""" lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)") node_id: str = Field(description="Node ID to get details for")
- eveng_mcp_server/tools/__init__.py:25-25 (registration)Registration call for node management tools within the overall register_tools function. This invokes register_node_tools which defines @mcp.tool()-decorated get_node_details handler.register_node_tools(mcp, eveng_client)
- eveng_mcp_server/server.py:53-53 (registration)Top-level registration of all MCP tools in the server startup, calling register_tools(mcp, eveng_client) which chains to node_management registration including get_node_details.register_tools(self.mcp, self.eveng_client)
- Helper utility used by get_node_details to convert numeric node status codes (0-3) to readable strings like 'Running', 'Stopped'.def _get_status_text(status: int) -> str: """Convert node status code to human-readable text.""" status_map = { 0: "Stopped", 1: "Starting", 2: "Running", 3: "Stopping" } return status_map.get(status, f"Unknown ({status})")