Skip to main content
Glama
moimran

EVE-NG MCP Server

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)}")
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses key behavioral traits: 'gracefully shut down' (non-destructive) and 'states preserved' (data retention). However, it doesn't mention permissions needed, potential side effects, error conditions, or what 'gracefully' entails operationally.

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?

Two well-structured sentences: first states the core purpose, second adds important behavioral details. Zero wasted words, appropriately sized for a single-parameter tool. Front-loaded with the essential action in the opening sentence.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and 0% schema coverage, the description provides adequate purpose and basic behavioral context but lacks parameter details, error handling information, and operational constraints. For a mutation tool affecting multiple nodes, more completeness would be beneficial.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate. It mentions 'specified lab' which hints at the lab_path parameter, but provides no details about parameter format, constraints, or examples. The description adds minimal semantic value beyond what's implied by the tool name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('stop all nodes') and target resource ('in a lab'), with the first sentence providing a concise purpose statement. It distinguishes from sibling tools like 'stop_node' (single node) and 'wipe_all_nodes' (destructive wipe vs graceful shutdown).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'in the specified lab' and contrasting with sibling tools through the 'all nodes' scope, but doesn't explicitly state when to use this vs alternatives like 'stop_node' for individual nodes or 'wipe_all_nodes' for destructive operations. No explicit when-not guidance is provided.

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