Skip to main content
Glama
moimran

EVE-NG MCP Server

by moimran

list_nodes

Retrieve information about all nodes in a specified EVE-NG lab, including status, configuration, and connectivity details.

Instructions

List all nodes in a lab.

This tool retrieves information about all nodes in the specified lab, including their status, configuration, and connectivity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • The MCP tool handler for 'list_nodes'. Takes lab_path, calls eveng_client.list_nodes(), formats output as formatted text with status icons and details.
    async def list_nodes(arguments: ListNodesArgs) -> list[TextContent]:
        """
        List all nodes in a lab.
    
        This tool retrieves information about all nodes in the specified lab,
        including their status, configuration, and connectivity.
        """
        try:
            logger.info(f"Listing nodes in lab: {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 nodes
            nodes = await eveng_client.list_nodes(arguments.lab_path)
    
            if not nodes.get('data'):
                return [TextContent(
                    type="text",
                    text=f"No nodes found in lab: {arguments.lab_path}"
                )]
    
            # Format nodes information
            nodes_text = f"Nodes in {arguments.lab_path}:\n\n"
    
            for node_id, node in nodes['data'].items():
                status_icon = "🟢" if node.get('status') == 2 else "🔴" if node.get('status') == 1 else "⚪"
                nodes_text += f"{status_icon} {node.get('name', f'Node {node_id}')} (ID: {node_id})\n"
                nodes_text += f"   Template: {node.get('template', 'Unknown')}\n"
                nodes_text += f"   Type: {node.get('type', 'Unknown')}\n"
                nodes_text += f"   Image: {node.get('image', 'Unknown')}\n"
                nodes_text += f"   Status: {_get_status_text(node.get('status', 0))}\n"
                nodes_text += f"   Console: {node.get('console', 'Unknown')}\n"
                nodes_text += f"   CPU: {node.get('cpu', 'Unknown')}\n"
                nodes_text += f"   RAM: {node.get('ram', 'Unknown')} MB\n"
                nodes_text += f"   Position: ({node.get('left', 0)}%, {node.get('top', 0)}%)\n"
                nodes_text += "\n"
    
            return [TextContent(
                type="text",
                text=nodes_text
            )]
    
        except Exception as e:
            logger.error(f"Failed to list nodes: {e}")
            return [TextContent(
                type="text",
                text=f"Failed to list nodes: {str(e)}"
            )]
  • Pydantic input schema for the list_nodes tool, defining the required lab_path parameter.
    class ListNodesArgs(BaseModel):
        """Arguments for list_nodes tool."""
        lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)")
  • Top-level registration of all tools, including node_management tools containing list_nodes, in the main EVENGMCPServer class.
    # Register tools
    register_tools(self.mcp, self.eveng_client)
  • Registration of node management tools (including list_nodes handler) via register_node_tools call within the overall register_tools function.
    # Node management tools
    register_node_tools(mcp, eveng_client)
    
    # Network management tools
    register_network_tools(mcp, eveng_client)
  • Helper method in EVENGClientWrapper that calls the underlying EVE-NG API to list nodes in a lab and handles errors.
    async def list_nodes(self, lab_path: str) -> Dict[str, Any]:
        """List all nodes in a lab."""
        await self.ensure_connected()
    
        try:
            nodes = await asyncio.to_thread(self.api.list_nodes, lab_path)
            self.logger.debug("Listed nodes", lab_path=lab_path)
            return nodes
        except Exception as e:
            self.logger.error("Failed to list nodes", **log_error(e, {"lab_path": lab_path}))
            raise EVENGAPIError(f"Failed to list nodes: {str(e)}")
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'retrieves information' (implying read-only) and lists included data types (status, configuration, connectivity), which is helpful. However, it doesn't cover critical aspects like whether it returns a summary or detailed view, pagination, error conditions, or authentication needs, leaving significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured in two sentences: the first states the core action, and the second elaborates on what information is retrieved. Every sentence adds value without redundancy, and it's front-loaded with the main purpose, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and low schema coverage, the description is moderately complete. It covers the purpose and data types returned, but lacks details on behavioral traits, error handling, and output structure. For a simple list tool, this is adequate but leaves room for improvement, especially in guiding usage among siblings.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% (the parameter 'lab_path' has no description in the schema), so the description must compensate. The description mentions 'specified lab' and implies the lab_path parameter, but doesn't explain its format, constraints, or examples beyond what's in the schema title. It adds minimal semantic value, meeting the baseline for low coverage without fully addressing the gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('list', 'retrieves') and resource ('nodes in a lab'), making the purpose evident. It distinguishes from siblings like 'get_node_details' by specifying it returns information about all nodes rather than a single node. However, it doesn't explicitly contrast with 'list_labs' or 'list_lab_networks', which would have made it a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_node_details' for single nodes or 'list_labs' for labs. It mentions the scope ('all nodes in the specified lab') but doesn't specify prerequisites, exclusions, or contextual alternatives, leaving the agent to infer usage from tool names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/moimran/eveng-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server