Skip to main content
Glama
moimran

EVE-NG MCP Server

by moimran

connect_node_to_network

Connect a node interface to a network in an EVE-NG lab to enable communication between devices through that network connection.

Instructions

Connect a node to a network.

This tool creates a connection between a node interface and a network in the lab, enabling communication through that network.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • The @mcp.tool()-decorated async handler function implementing the connect_node_to_network tool logic. It uses eveng_client.connect_node_to_cloud to perform the connection and returns formatted TextContent responses.
    @mcp.tool()
    async def connect_node_to_network(arguments: ConnectNodeToNetworkArgs) -> list[TextContent]:
        """
        Connect a node to a network.
    
        This tool creates a connection between a node interface and a network
        in the lab, enabling communication through that network.
        """
        try:
            logger.info(f"Connecting node {arguments.node_id} to network {arguments.network_id}")
    
            if not eveng_client.is_connected:
                return [TextContent(
                    type="text",
                    text="Not connected to EVE-NG server. Use connect_eveng_server tool first."
                )]
    
            # Connect node to network (cloud)
            result = await eveng_client.connect_node_to_cloud(
                arguments.lab_path,
                arguments.node_id,
                arguments.node_interface,
                arguments.network_id
            )
    
            if result.get('status') == 'success':
                return [TextContent(
                    type="text",
                    text=f"Successfully connected node to network!\n\n"
                         f"Lab: {arguments.lab_path}\n"
                         f"Node: {arguments.node_id}\n"
                         f"Interface: {arguments.node_interface}\n"
                         f"Network: {arguments.network_id}\n\n"
                         f"Connection established successfully."
                )]
            else:
                return [TextContent(
                    type="text",
                    text=f"Failed to connect node to network: {result.get('message', 'Unknown error')}"
                )]
    
        except Exception as e:
            logger.error(f"Failed to connect node to network: {e}")
            return [TextContent(
                type="text",
                text=f"Failed to connect node to network: {str(e)}"
            )]
  • Pydantic BaseModel schema defining the input arguments for the connect_node_to_network tool.
    class ConnectNodeToNetworkArgs(BaseModel):
        """Arguments for connect_node_to_network tool."""
        lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)")
        node_id: str = Field(description="Source node ID")
        node_interface: str = Field(description="Node interface name (e.g., 'Gi0/0', 'eth0')")
        network_id: str = Field(description="Target network ID")
  • Registration call to register_network_tools which defines and registers the connect_node_to_network tool using @mcp.tool() inside the function.
    # Network management tools
    register_network_tools(mcp, eveng_client)
  • Top-level registration in the main server class, calling register_tools which chains to all tool registrations including network management tools.
    # Register tools
    register_tools(self.mcp, self.eveng_client)
  • Documentation reference for the tool in the static API reference resource.
    ### connect_node_to_network
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 connection' which implies a write/mutation operation, but doesn't specify permissions needed, whether it's idempotent, error conditions (e.g., invalid interface), or side effects (e.g., network changes). 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.

Conciseness5/5

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

The description is appropriately sized and front-loaded: the first sentence states the core purpose, and the second elaborates without redundancy. Every sentence earns its place by clarifying the action and outcome, with no wasted words.

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 connecting network components), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't cover behavioral aspects like success/failure responses, prerequisites, or error handling, which are crucial for an agent to use this tool effectively in a lab environment.

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 description doesn't mention any parameters explicitly. With schema description coverage at 0% (parameters are documented only with titles like 'Lab Path', 'Node Id'), the description doesn't compensate by explaining what arguments are needed or their roles. However, the tool has only 1 parameter (an object with nested properties), so the baseline is slightly higher than minimal, but it fails to add meaning beyond the schema.

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: 'Connect a node to a network' and elaborates with 'creates a connection between a node interface and a network in the lab, enabling communication through that network.' This specifies the verb (connect/create connection) and resource (node interface to network), but doesn't explicitly differentiate from sibling tools like connect_node_to_node, which is why it's not 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. It doesn't mention prerequisites (e.g., lab must exist, node must be in lab), when not to use it (e.g., if already connected), or refer to sibling tools like connect_node_to_node for different connection types. This leaves the agent without context for tool selection.

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