Skip to main content
Glama
moimran

EVE-NG MCP Server

by moimran

create_lab_network

Add a network (bridge, cloud, NAT) to an EVE-NG lab topology with configurable positioning for network emulation setups.

Instructions

Create a network in a lab.

This tool creates a new network (cloud, bridge, NAT, etc.) in the lab with the specified type and positioning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • The main handler function for the 'create_lab_network' tool. It handles input validation, EVE-NG connection check, creates the network using eveng_client.add_lab_network, and returns formatted TextContent responses.
    @mcp.tool()
    async def create_lab_network(arguments: CreateNetworkArgs) -> list[TextContent]:
        """
        Create a network in a lab.
    
        This tool creates a new network (cloud, bridge, NAT, etc.) in the lab
        with the specified type and positioning.
        """
        try:
            logger.info(f"Creating network 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."
                )]
    
            # Create network
            result = await eveng_client.add_lab_network(
                arguments.lab_path,
                arguments.network_type,
                name=arguments.name,
                left=arguments.left,
                top=arguments.top,
                visibility=1  # Make network visible by default
            )
    
            if result.get('status') == 'success':
                net_id = result.get('data', {}).get('id', 'Unknown')
                return [TextContent(
                    type="text",
                    text=f"Successfully created network in lab!\n\n"
                         f"Lab: {arguments.lab_path}\n"
                         f"Network Type: {arguments.network_type}\n"
                         f"Network ID: {net_id}\n"
                         f"Name: {arguments.name or f'Network{net_id}'}\n"
                         f"Position: ({arguments.left}%, {arguments.top}%)\n\n"
                         f"Network created successfully. You can now connect nodes to it."
                )]
            else:
                return [TextContent(
                    type="text",
                    text=f"Failed to create network: {result.get('message', 'Unknown error')}"
                )]
    
        except Exception as e:
            logger.error(f"Failed to create network: {e}")
            return [TextContent(
                type="text",
                text=f"Failed to create network: {str(e)}"
            )]
  • Pydantic model defining the input schema (arguments) for the create_lab_network tool.
    class CreateNetworkArgs(BaseModel):
        """Arguments for create_network tool."""
        lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)")
        network_type: str = Field(description="Network type (bridge, cloud, nat, etc.)")
        name: str = Field(default="", description="Network name (optional)")
        left: int = Field(default=50, description="Position from left (percentage, 0-100)")
        top: int = Field(default=50, description="Position from top (percentage, 0-100)")
  • Registration of network management tools, including create_lab_network, by calling register_network_tools during the overall tools registration process.
    # Network management tools
    register_network_tools(mcp, eveng_client)
  • Top-level registration call in the server initialization that triggers the registration of all tools, including create_lab_network.
    register_tools(self.mcp, self.eveng_client)
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 creates a network but lacks details on permissions required, whether the operation is idempotent, error conditions, or what happens on success (e.g., returns a network ID). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is appropriately sized with two sentences: the first states the purpose, and the second adds specifics. It's front-loaded with the core action. However, the second sentence could be more structured (e.g., bullet points for parameters) to improve clarity without adding length.

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 complexity (a mutation tool with 5 sub-parameters), no annotations, and no output schema, the description is incomplete. It doesn't cover parameter details, behavioral traits, error handling, or return values. For a tool that creates resources in a lab environment, more context is needed to guide effective use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but fails to do so. It mentions 'type and positioning' which loosely maps to 'network_type', 'left', and 'top' parameters, but doesn't explain the 'lab_path' or 'name' parameters. With 1 parameter (a nested object with 5 sub-properties) and no schema descriptions, the description adds minimal value beyond what's inferred from parameter names.

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 action ('creates a new network') and resource ('in a lab'), with additional context about network types (cloud, bridge, NAT, etc.) and positioning. It distinguishes from siblings like 'list_lab_networks' or 'delete_lab_network' by specifying creation. However, it doesn't explicitly differentiate from other creation tools like 'create_lab' beyond the resource type.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing lab from 'create_lab'), exclusions, or comparisons to siblings like 'list_network_types' for type selection. The description implies usage for network creation but offers no contextual boundaries.

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