Skip to main content
Glama
moimran
by moimran

delete_lab_network

Remove a network from an EVE-NG lab to clean up network topology. This action permanently deletes the network and all its connections.

Instructions

Delete a network from a lab.

This tool permanently removes a network from the lab. All connections to this network will be lost. This action cannot be undone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • MCP tool handler function that implements the delete_lab_network tool logic. Validates arguments, checks EVE-NG connection, calls the client wrapper, handles success/error responses, and returns formatted TextContent.
    async def delete_lab_network(arguments: DeleteNetworkArgs) -> list[TextContent]: """ Delete a network from a lab. This tool permanently removes a network from the lab. All connections to this network will be lost. This action cannot be undone. """ try: logger.info(f"Deleting network {arguments.network_id} from {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." )] # Delete network result = await eveng_client.delete_lab_network(arguments.lab_path, int(arguments.network_id)) if result.get('status') == 'success': return [TextContent( type="text", text=f"Successfully deleted network {arguments.network_id} from {arguments.lab_path}\n\n" f"⚠️ The network has been permanently removed from the lab.\n" f"All connections to this network have been lost.\n" f"This action cannot be undone." )] else: return [TextContent( type="text", text=f"Failed to delete network: {result.get('message', 'Unknown error')}" )] except Exception as e: logger.error(f"Failed to delete network: {e}") return [TextContent( type="text", text=f"Failed to delete network: {str(e)}" )]
  • Pydantic model defining input schema/arguments for the delete_lab_network tool: lab_path and network_id.
    class DeleteNetworkArgs(BaseModel): """Arguments for delete_network tool.""" lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)") network_id: str = Field(description="Network ID to delete")
  • Helper method in EVENGClientWrapper that wraps the EVE-NG SDK API call to delete_lab_network, including connection check, async thread execution, logging, and error handling.
    async def delete_lab_network(self, lab_path: str, net_id: int) -> Dict[str, Any]: """Delete a network from a lab.""" await self.ensure_connected() try: result = await asyncio.to_thread(self.api.delete_lab_network, lab_path, net_id) self.logger.info("Deleted lab network", lab_path=lab_path, net_id=net_id) return result except Exception as e: self.logger.error("Failed to delete lab network", **log_error(e, {"lab_path": lab_path, "net_id": net_id})) raise EVENGAPIError(f"Failed to delete lab network: {str(e)}")
  • Registration call for network management tools (including delete_lab_network) within the overall tools registration in tools/__init__.py.
    # Network management tools register_network_tools(mcp, eveng_client)
  • Top-level registration of all tools (including network tools with delete_lab_network) in the main MCP server initialization.
    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