Skip to main content
Glama

ako_restart

Destructive

Restart AKO pod by deleting it for automatic recreation. Solves stuck states or applies config changes. Confirmation required.

Instructions

[WRITE] Restart AKO pod by deleting it (K8s recreates automatically).

Use when AKO is stuck or after config changes. Brief traffic disruption possible during restart.

SAFETY: Requires confirmed=True to execute. Default False returns a preview message describing the intended action.

Args: context: K8s context name (optional). confirmed: Must be True to actually restart the AKO pod. Default False returns a preview-only message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contextNo
confirmedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler that exposes ako_restart. Requires confirmed=True to execute; otherwise returns a preview message. Delegates to vmware_avi.ops.ako_pod.restart_ako with skip_prompt=True.
    @mcp.tool(annotations={"readOnlyHint": False, "destructiveHint": True, "idempotentHint": False, "openWorldHint": True})
    @vmware_tool(risk_level="high")
    def ako_restart(context: str | None = None, confirmed: bool = False) -> str:
        """[WRITE] Restart AKO pod by deleting it (K8s recreates automatically).
    
        Use when AKO is stuck or after config changes. Brief traffic disruption possible during restart.
    
        SAFETY: Requires confirmed=True to execute. Default False returns a preview message
        describing the intended action.
    
        Args:
            context: K8s context name (optional).
            confirmed: Must be True to actually restart the AKO pod.
                Default False returns a preview-only message.
        """
        if not confirmed:
            ctx_hint = f" in context '{context}'" if context else ""
            return (
                f"[preview] Would delete the AKO pod{ctx_hint} — K8s will recreate it automatically. "
                "Brief traffic disruption is possible during restart. "
                "Re-invoke with confirmed=True to execute."
            )
        from vmware_avi.ops.ako_pod import restart_ako
        return _capture_output(restart_ako, context, skip_prompt=True)
  • Core helper function that finds the AKO pod via label selector and deletes it using the Kubernetes API. When called from the MCP tool, skip_prompt=True skips the double-confirm prompt.
    def restart_ako(context: str | None = None, *, skip_prompt: bool = False) -> None:
        """Restart AKO pod by deleting it (deployment recreates it).
    
        Args:
            context: K8s context name (optional, uses current context).
            skip_prompt: When True, bypass the interactive double-confirm prompt.
                Used by MCP callers that enforce confirmation via the ``confirmed``
                parameter before reaching this function.
        """
        if not skip_prompt:
            from vmware_avi._safety import double_confirm
    
            if not double_confirm("Restart AKO pod"):
                console.print("[yellow]Cancelled.[/yellow]")
                return
    
        cfg = load_config()
        k8s = K8sConnectionManager(cfg)
        v1 = k8s.core_v1(context)
        ns = k8s.namespace
    
        pod_name = _get_ako_pod_name(v1, ns)
        v1.delete_namespaced_pod(pod_name, ns)
        console.print(f"[green]AKO pod '{pod_name}' deleted. Deployment will recreate it.[/green]")
  • MCP tool registration via @mcp.tool decorator with annotations marking it as destructive, non-read-only, and non-idempotent.
    @mcp.tool(annotations={"readOnlyHint": False, "destructiveHint": True, "idempotentHint": False, "openWorldHint": True})
    @vmware_tool(risk_level="high")
    def ako_restart(context: str | None = None, confirmed: bool = False) -> str:
  • Input schema: context (optional str) and confirmed (bool, default False) as the two parameters.
    Args:
        context: K8s context name (optional).
        confirmed: Must be True to actually restart the AKO pod.
            Default False returns a preview-only message.
  • CLI registration of ako_restart as a Typer subcommand under the 'ako' app group.
    @ako_app.command("restart")
    def ako_restart(
        context: str | None = typer.Option(None, help="K8s context"),
    ) -> None:
        """Restart AKO pod (requires confirmation)."""
        from vmware_avi.ops.ako_pod import restart_ako
    
        restart_ako(context)
Behavior5/5

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

Discloses destructive nature (delete and recreate), traffic disruption, and the safety mechanism (confirmed flag). Adds value beyond annotations indicating destructiveness.

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?

Concise with clear sections (action, use case, safety, args). Every sentence adds value with no redundancy.

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

Completeness4/5

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

Covers purpose, usage, safety, and parameters adequately. Has output schema so return format is not needed. Slight lack of detail on context parameter usage.

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?

Explains confirmed parameter well (must be True to execute, preview otherwise). Context parameter only mentioned as optional K8s context name. Schema has no descriptions so description partially compensates.

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 tool restarts the AKO pod by deleting it, with a specific verb and resource. It distinguishes from siblings which are mostly query/status tools.

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?

Explicitly states when to use (AKO stuck or after config changes) and mentions traffic disruption. Lacks explicit alternatives but provides clear context for usage.

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/zw008/VMware-AVI'

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