Skip to main content
Glama

restart_vllm

Restart a vLLM Docker container to resolve issues or apply configuration changes, enabling continued AI model serving.

Instructions

Restart a vLLM Docker container

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
container_nameNoName of the container to restart

Implementation Reference

  • The main handler function that restarts a vLLM container. It checks if the runtime is running, gets the container name, verifies the container exists, executes the restart command, and returns appropriate success/error messages.
    async def restart_vllm(arguments: dict[str, Any]) -> list[TextContent]:
        """
        Restart a vLLM container.
    
        Args:
            arguments: Dictionary containing:
                - container_name: Name of container to restart (default: from settings)
    
        Returns:
            List of TextContent with the result.
        """
        settings = get_settings()
        
        platform_info = await get_platform_info()
        if not platform_info.runtime_running:
            runtime_name = platform_info.container_runtime.value.capitalize() if platform_info.container_runtime != ContainerRuntime.NONE else "Container runtime"
            return [TextContent(type="text", text=f"❌ Error: {runtime_name} is not running.")]
    
        runtime_cmd = _get_runtime_cmd(platform_info.container_runtime)
        container_name = arguments.get("container_name", settings.container_name)
    
        if not await _is_container_exists(container_name, platform_info.container_runtime):
            return [TextContent(
                type="text",
                text=f"❌ Container '{container_name}' does not exist.\n"
                     f"Use `start_vllm` to create a new container."
            )]
    
        exit_code, _, stderr = await _run_command([runtime_cmd, "restart", container_name])
        
        if exit_code != 0:
            return [TextContent(
                type="text",
                text=f"❌ Failed to restart container: {stderr}"
            )]
    
        return [TextContent(
            type="text",
            text=f"✅ Container '{container_name}' restarted.\n\n"
                 f"⏳ The model may take a minute to reload. Use `vllm_status` to check."
        )]
  • Registration of the restart_vllm tool with its input schema (container_name optional string parameter) and description.
        name="restart_vllm",
        description="Restart a vLLM Docker container",
        inputSchema={
            "type": "object",
            "properties": {
                "container_name": {
                    "type": "string",
                    "description": "Name of the container to restart",
                },
            },
        },
    ),
  • Routing logic that maps the 'restart_vllm' tool name to the handler function call.
    elif name == "restart_vllm":
        return await restart_vllm(arguments)
  • Import statement that imports restart_vllm from the server_control module.
    from vllm_mcp_server.tools.server_control import (
        get_platform_status,
        get_vllm_logs,
        list_vllm_containers,
        restart_vllm,
        start_vllm,
        stop_vllm,
  • Export of restart_vllm from the tools package's public API.
    restart_vllm,
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Restart') but doesn't explain what this entails (e.g., whether it stops and starts the container, potential downtime, or effects on running processes). No information on permissions, side effects, or error handling is included, which is a significant gap for a mutation tool.

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 a single, direct sentence with zero waste—it states the action and target without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

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 of restarting a container (a mutation with potential side effects), no annotations, and no output schema, the description is incomplete. It lacks details on behavior, outcomes, or error conditions, which are crucial for safe tool invocation in this context.

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

Parameters3/5

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

The input schema has 100% description coverage, with the parameter 'container_name' clearly documented. The description doesn't add any meaning beyond the schema (e.g., it doesn't specify valid container names or examples), so it meets the baseline of 3 where the schema does the heavy lifting.

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 action ('Restart') and target resource ('a vLLM Docker container'), making the purpose immediately understandable. It distinguishes from siblings like 'start_vllm' and 'stop_vllm' by specifying the restart operation, though it doesn't explicitly contrast with them in the text.

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 on when to use this tool versus alternatives like 'start_vllm' or 'stop_vllm', or what prerequisites might be needed (e.g., container must be running). The description lacks context about appropriate scenarios or exclusions, leaving usage unclear.

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/micytao/vllm-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server