Skip to main content
Glama
moimran
by moimran

create_lab

Create a new network lab in EVE-NG with specified name and metadata to build and test network topologies.

Instructions

Create a new lab in EVE-NG.

This tool creates a new lab with the specified name and metadata in the given path on the EVE-NG server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
pathNo/
descriptionNo
authorNo
versionNo1

Implementation Reference

  • Pydantic model defining the input schema/arguments for the create_lab tool.
    class CreateLabArgs(BaseModel): """Arguments for create_lab tool.""" name: str = Field(description="Name of the lab") path: str = Field(default="/", description="Path where to create the lab (default: /)") description: str = Field(default="", description="Lab description") author: str = Field(default="", description="Lab author") version: str = Field(default="1", description="Lab version")
  • The core handler function for the 'create_lab' tool. It checks connection, calls the EVE-NG client to create the lab, and returns success or error messages as TextContent.
    @mcp.tool() async def create_lab(name: str, path: str = "/", description: str = "", author: str = "", version: str = "1") -> list[TextContent]: """ Create a new lab in EVE-NG. This tool creates a new lab with the specified name and metadata in the given path on the EVE-NG server. """ try: logger.info(f"Creating lab: {name} in {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 lab lab = await eveng_client.create_lab( name=name, path=path, description=description, author=author, version=version ) return [TextContent( type="text", text=f"Successfully created lab!\n\n" f"Name: {name}\n" f"Path: {path}\n" f"Description: {description}\n" f"Author: {author}\n" f"Version: {version}\n\n" f"Lab is ready for adding nodes and networks." )] except Exception as e: logger.error(f"Failed to create lab: {e}") return [TextContent( type="text", text=f"Failed to create lab: {str(e)}" )]
  • Registration call for lab management tools (including create_lab) within the central register_tools function.
    # Lab management tools register_lab_tools(mcp, eveng_client)
  • Top-level registration of all tools (including create_lab) in the MCP server initialization.
    # Register tools register_tools(self.mcp, self.eveng_client)

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