Skip to main content
Glama
moimran

EVE-NG MCP Server

by moimran

list_lab_networks

Retrieve all network configurations and connections within a specified EVE-NG lab to analyze topology and relationships.

Instructions

List all networks in a lab.

This tool retrieves information about all networks configured in the specified lab, including their types and connections.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • MCP tool handler: lists networks in the specified lab by calling eveng_client.list_lab_networks and formatting the response as TextContent.
    @mcp.tool()
    async def list_lab_networks(arguments: ListNetworksArgs) -> list[TextContent]:
        """
        List all networks in a lab.
    
        This tool retrieves information about all networks configured
        in the specified lab, including their types and connections.
        """
        try:
            logger.info(f"Listing networks 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 lab networks
            networks = await eveng_client.list_lab_networks(arguments.lab_path)
    
            if not networks.get('data'):
                return [TextContent(
                    type="text",
                    text=f"No networks found in lab: {arguments.lab_path}"
                )]
    
            # Format networks information
            networks_text = f"Networks in {arguments.lab_path}:\n\n"
    
            for net_id, network in networks['data'].items():
                networks_text += f"🌐 {network.get('name', f'Network {net_id}')} (ID: {net_id})\n"
                networks_text += f"   Type: {network.get('type', 'Unknown')}\n"
                networks_text += f"   Visibility: {'Visible' if network.get('visibility') == 1 else 'Hidden'}\n"
                networks_text += f"   Position: ({network.get('left', 0)}%, {network.get('top', 0)}%)\n"
                networks_text += "\n"
    
            return [TextContent(
                type="text",
                text=networks_text
            )]
    
        except Exception as e:
            logger.error(f"Failed to list lab networks: {e}")
            return [TextContent(
                type="text",
                text=f"Failed to list lab networks: {str(e)}"
            )]
  • Pydantic schema for tool input: requires lab_path (full path to the .unl lab file).
    class ListNetworksArgs(BaseModel):
        """Arguments for list_networks tool."""
        lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)")
  • Calls register_network_tools which defines and registers the list_lab_networks handler using @mcp.tool() decorator.
    # Network management tools
    register_network_tools(mcp, eveng_client)
  • EVENGClientWrapper helper method that wraps the EVE-NG API call to list networks in a lab.
    async def list_lab_networks(self, lab_path: str) -> Dict[str, Any]:
        """List all networks in a lab."""
        await self.ensure_connected()
    
        try:
            networks = await asyncio.to_thread(self.api.list_lab_networks, lab_path)
            self.logger.debug("Listed lab networks", lab_path=lab_path)
            return networks
        except Exception as e:
            self.logger.error("Failed to list lab networks", **log_error(e, {"lab_path": lab_path}))
            raise EVENGAPIError(f"Failed to list lab networks: {str(e)}")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'retrieves information' and lists networks, implying a read-only operation, but does not specify details like whether it requires authentication, how it handles errors, if there are rate limits, or what the output format looks like. For a tool with no annotations, this leaves significant behavioral gaps.

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 appropriately sized and front-loaded: it starts with a clear purpose statement ('List all networks in a lab.'), followed by a slightly more detailed sentence. There is no wasted text, and every sentence adds value by elaborating on the scope of information retrieved. It is efficient and well-structured.

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

Completeness2/5

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

Given the context: no annotations, no output schema, 1 parameter with low schema coverage, and moderate complexity (listing networks in a lab), the description is incomplete. It lacks details on behavioral aspects like authentication needs, error handling, or output format, and does not address parameter usage. For a tool that interacts with lab configurations, more context is needed to guide the agent effectively.

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?

The input schema has 1 parameter with 0% description coverage, as the schema's description ('Arguments for list_networks tool.') is generic. The tool description does not mention the 'lab_path' parameter or explain its semantics, such as what format the path should be in or examples beyond the schema's hint. Since schema coverage is low, the description does not compensate, but with only 1 parameter, the baseline is adjusted to 3 as it's minimally adequate.

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 tool's purpose: 'List all networks in a lab' and 'retrieves information about all networks configured in the specified lab'. It specifies the verb ('list', 'retrieves') and resource ('networks in a lab'), making the action clear. However, it does not explicitly distinguish this tool from sibling tools like 'list_network_types' or 'get_lab_topology', which might also involve network-related information, so it misses full sibling differentiation.

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. It does not mention any prerequisites, such as needing an existing lab, or compare it to siblings like 'list_network_types' (which might list network types rather than configured networks) or 'get_lab_topology' (which might provide a broader view). Without such context, the agent lacks clear usage instructions.

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