Skip to main content
Glama
moimran
by moimran

stop_all_nodes

Gracefully shut down all running nodes in an EVE-NG lab to preserve their states and stop network emulation.

Instructions

Stop all nodes in a lab.

This tool stops all running nodes in the specified lab. All nodes will be gracefully shut down and their states preserved.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argumentsYes

Implementation Reference

  • The MCP tool handler function that executes the 'stop_all_nodes' logic. It handles input validation via Pydantic, checks EVE-NG connection, calls the underlying client API, and returns formatted TextContent response.
    async def stop_all_nodes(arguments: BulkNodeControlArgs) -> list[TextContent]: """ Stop all nodes in a lab. This tool stops all running nodes in the specified lab. All nodes will be gracefully shut down and their states preserved. """ try: logger.info(f"Stopping all nodes in {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." )] # Stop all nodes result = await eveng_client.stop_all_nodes(arguments.lab_path) if result.get('status') == 'success': return [TextContent( type="text", text=f"Successfully stopped all nodes in {arguments.lab_path}\n\n" f"All nodes have been shut down and their states preserved." )] else: return [TextContent( type="text", text=f"Failed to stop all nodes: {result.get('message', 'Unknown error')}" )] except Exception as e: logger.error(f"Failed to stop all nodes: {e}") return [TextContent( type="text", text=f"Failed to stop all nodes: {str(e)}" )]
  • Pydantic BaseModel defining the input schema for the stop_all_nodes tool (and other bulk node operations), specifying the required lab_path parameter.
    class BulkNodeControlArgs(BaseModel): """Arguments for bulk node operations.""" lab_path: str = Field(description="Full path to the lab (e.g., /lab_name.unl)")
  • Top-level registration call in the main server class that registers all tools, including the node management tools containing stop_all_nodes, by invoking tools/__init__.py:register_tools.
    # Register tools register_tools(self.mcp, self.eveng_client)
  • Helper method in the EVE-NG client wrapper that performs the actual API call to stop all nodes via the evengsdk, with connection management and error handling.
    async def stop_all_nodes(self, lab_path: str) -> Dict[str, Any]: """Stop all nodes in a lab.""" await self.ensure_connected() try: result = await asyncio.to_thread(self.api.stop_all_nodes, lab_path) self.logger.info("Stopped all nodes", lab_path=lab_path) return result except Exception as e: self.logger.error("Failed to stop all nodes", **log_error(e, {"lab_path": lab_path})) raise EVENGAPIError(f"Failed to stop all nodes: {str(e)}")

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