Skip to main content
Glama

list_workflows

Read-onlyIdempotent

List available workflow templates including built-in and custom ones loaded from YAML files. Returns names, descriptions, and step counts.

Instructions

[READ] List all available workflow templates (built-in + custom).

Built-in templates are always available. Custom templates are loaded from ~/.vmware/workflows/*.yaml — drop a YAML file there to add your own workflows.

Returns: dict with builtin and custom workflow lists, each with name, description, steps count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler for the list_workflows MCP tool. Lists built-in templates (from BUILTIN_TEMPLATES) and custom YAML workflows (via list_custom_workflows), plus active workflows from the store.
    @mcp.tool(annotations={"readOnlyHint": True, "destructiveHint": False, "idempotentHint": True, "openWorldHint": True})
    @vmware_tool(risk_level="low")
    def list_workflows() -> dict:
        """[READ] List all available workflow templates (built-in + custom).
    
        Built-in templates are always available. Custom templates are loaded
        from ~/.vmware/workflows/*.yaml — drop a YAML file there to add
        your own workflows.
    
        Returns:
            dict with builtin and custom workflow lists, each with name, description, steps count.
        """
        from vmware_pilot.custom_loader import list_custom_workflows
        from vmware_pilot.templates import BUILTIN_TEMPLATES
    
        builtin = [
            {"name": name, "type": "builtin", "description": (fn.__doc__ or "").split("\n")[0].strip()}
            for name, fn in BUILTIN_TEMPLATES.items()
        ]
        custom = [
            {**c, "type": "custom"}
            for c in list_custom_workflows()
        ]
    
        active = _get_store().list_active()
    
        try:
            return {
                "templates": builtin + custom,
                "active_workflows": active,
            }
        except Exception as e:
            return {"error": str(e), "hint": "Failed to list workflows."}
  • Registration of list_workflows as an MCP tool via @mcp.tool decorator with read-only annotations and low risk level.
    @mcp.tool(annotations={"readOnlyHint": True, "destructiveHint": False, "idempotentHint": True, "openWorldHint": True})
    @vmware_tool(risk_level="low")
    def list_workflows() -> dict:
  • Helper function that scans ~/.vmware/workflows/*.yaml and returns a list of custom workflow metadata dicts.
    def list_custom_workflows() -> list[dict[str, str]]:
        """List available custom workflow files (for discovery)."""
        if not _WORKFLOWS_DIR.exists():
            return []
    
        result = []
        try:
            import yaml
        except ImportError:
            return []
    
        for path in sorted(_WORKFLOWS_DIR.glob("*.yaml")):
            try:
                with open(path) as fh:
                    spec = yaml.safe_load(fh)
                if spec and "name" in spec:
                    result.append({
                        "name": spec["name"],
                        "description": spec.get("description", ""),
                        "file": path.name,
                        "steps": len(spec.get("steps", [])),
                    })
            except Exception:
                pass
    
        return result
  • Definition of BUILTIN_TEMPLATES dict containing all built-in workflow template names mapped to their factory functions.
    BUILTIN_TEMPLATES = {
        "clone_and_test": clone_and_test,
        "incident_response": incident_response,
        "investigate_alert": investigate_alert,
        "plan_and_approve": plan_and_approve,
        "compliance_scan": compliance_scan,
        "network_segment_setup": network_segment_setup,
        "vks_cluster_deploy": vks_cluster_deploy,
        "rolling_restart": rolling_restart,
        "capacity_expansion": capacity_expansion,
        "disaster_recovery": disaster_recovery,
        "patch_deployment": patch_deployment,
        "storage_expansion": storage_expansion,
        "baseline_capture": baseline_capture,
        "baseline_audit": baseline_audit,
        "baseline_remediate": baseline_remediate,
    }
  • Helper method on WorkflowStore that queries the SQLite DB for active (non-completed, non-failed) workflows.
    def list_active(self) -> list[dict[str, Any]]:
        conn = self._connect()
        rows = conn.execute(
            "SELECT id, type, state, created_at, updated_at FROM workflows "
            "WHERE state NOT IN ('completed', 'failed') ORDER BY created_at DESC"
        ).fetchall()
        conn.close()
        return [
            {"id": r[0], "type": r[1], "state": r[2], "created_at": r[3], "updated_at": r[4]}
            for r in rows
        ]
Behavior5/5

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

Beyond annotations (readOnlyHint, etc.), the description details the return format (dict with builtin/custom lists, each with name/description/steps count) and the file-based custom template mechanism, adding significant behavioral insight.

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 concise paragraphs, first bolded purpose, second adding detail. Every sentence adds value; no redundancy or fluff.

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

Completeness5/5

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

Given no output schema, description fully explains return structure. With 0 parameters and a simple list operation, it is complete and sufficient for an agent.

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

Parameters4/5

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

Input schema has 0 parameters with 100% coverage, so baseline is 4. Description adds no parameter info (none needed), meeting expectations.

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?

Description clearly states 'List all available workflow templates (built-in + custom).' with a verb ('list') and resource ('workflow templates'). It distinguishes from sibling tools like create_workflow or run_workflow by its read-only nature.

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?

Describes when to use (to see available templates) and provides context about custom template loading. Does not explicitly state when not to use or name alternatives, but the read vs. write distinction is clear among siblings.

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-Pilot'

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