Skip to main content
Glama
moimran

EVE-NG MCP Server

by moimran

connect_node_to_node

Create direct point-to-point connections between nodes in EVE-NG network labs to enable communication between devices.

Instructions

Connect two nodes together directly.

This tool creates a direct point-to-point connection between two nodes in the lab, enabling direct communication between them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • MCP tool handler: @mcp.tool()-decorated function that validates arguments, checks connection, calls eveng_client.connect_node_to_node, and returns formatted TextContent response.
    @mcp.tool()
    async def connect_node_to_node(arguments: ConnectNodeToNodeArgs) -> list[TextContent]:
        """
        Connect two nodes together directly.
    
        This tool creates a direct point-to-point connection between two nodes
        in the lab, enabling direct communication between them.
        """
        try:
            logger.info(f"Connecting node {arguments.src_node_id} to node {arguments.dst_node_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 nodes together
            result = await eveng_client.connect_node_to_node(
                arguments.lab_path,
                arguments.src_node_id,
                arguments.src_interface,
                arguments.dst_node_id,
                arguments.dst_interface
            )
    
            if result:  # connect_node_to_node returns boolean
                return [TextContent(
                    type="text",
                    text=f"Successfully connected nodes!\n\n"
                         f"Lab: {arguments.lab_path}\n"
                         f"Source Node: {arguments.src_node_id} ({arguments.src_interface})\n"
                         f"Destination Node: {arguments.dst_node_id} ({arguments.dst_interface})\n\n"
                         f"Point-to-point connection established successfully."
                )]
            else:
                return [TextContent(
                    type="text",
                    text="Failed to connect nodes: Connection could not be established."
                )]
    
        except Exception as e:
            logger.error(f"Failed to connect nodes: {e}")
            return [TextContent(
                type="text",
                text=f"Failed to connect nodes: {str(e)}"
            )]
  • Pydantic BaseModel defining the input schema/arguments for the connect_node_to_node tool.
    class ConnectNodeToNodeArgs(BaseModel):
        """Arguments for connect_node_to_node tool."""
        lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)")
        src_node_id: str = Field(description="Source node ID")
        src_interface: str = Field(description="Source node interface name")
        dst_node_id: str = Field(description="Destination node ID")
        dst_interface: str = Field(description="Destination node interface name")
  • Helper method in EVENGClientWrapper that wraps the underlying evengsdk.api.connect_node_to_node call with error handling and logging.
    async def connect_node_to_node(self, lab_path: str, src: str, src_label: str, dst: str, dst_label: str) -> Dict[str, Any]:
        """Connect two nodes together."""
        await self.ensure_connected()
    
        try:
            result = await asyncio.to_thread(self.api.connect_node_to_node, lab_path, src, src_label, dst, dst_label)
            self.logger.info("Connected nodes", lab_path=lab_path, src=src, dst=dst)
            return result
        except Exception as e:
            self.logger.error("Failed to connect nodes", **log_error(e, {"lab_path": lab_path, "src": src, "dst": dst}))
            raise EVENGAPIError(f"Failed to connect nodes: {str(e)}")
  • Registration call for network tools (including connect_node_to_node) during overall tools registration.
    # Network management tools
    register_network_tools(mcp, eveng_client)
  • Top-level registration of all tools in the MCP server startup.
    # Register tools
    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 full burden for behavioral disclosure. It states the tool creates connections but lacks critical details: whether this is a mutation (implied by 'creates'), permission requirements, error conditions (e.g., invalid interfaces), idempotency, or what happens on success/failure. The description adds minimal behavioral context beyond the basic action.

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 concise with two sentences that directly explain the tool's purpose. It's front-loaded with the main action and avoids unnecessary details. Every sentence earns its place by clarifying the connection type.

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 (mutation tool with 5 parameters, no annotations, no output schema), the description is incomplete. It explains what the tool does at a high level but lacks parameter guidance, behavioral details, error handling, and output expectations. For a tool that modifies lab topology, this leaves significant gaps for an AI agent.

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

Parameters1/5

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

Schema description coverage is 0% (the schema has descriptions but they're generic like 'Arguments for connect_node_to_node tool'), so the description must compensate. However, the description provides zero information about any parameters—it doesn't mention lab_path, node IDs, interfaces, or their semantics. This leaves all 5 required parameters undocumented.

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 two nodes together directly' and 'creates a direct point-to-point connection between two nodes in the lab, enabling direct communication between them.' This specifies the verb (connect/create) and resource (nodes), but doesn't explicitly differentiate from sibling tools like 'connect_node_to_network' or 'test_connection'.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., nodes must exist), exclusions (e.g., cannot connect nodes already connected), or comparisons to sibling tools like 'connect_node_to_network' for different connection types.

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