pv_list
List all PersistentVolumes in a Kubernetes cluster to monitor storage resources and manage volume allocations.
Instructions
List all PersistentVolumes in the cluster.
Args: context_name: The Kubernetes context name
Returns: List of PersistentVolume basic information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes |
Implementation Reference
- tools/pv.py:8-23 (handler)The pv_list tool handler: lists all PersistentVolumes in the Kubernetes cluster using CoreV1Api, returning name, capacity, and access_modes for each.@mcp.tool() @use_current_context def pv_list(context_name: str): """ List all PersistentVolumes in the cluster. Args: context_name: The Kubernetes context name Returns: List of PersistentVolume basic information """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] pvs = core_v1.list_persistent_volume() result = [{"name": pv.metadata.name, "capacity": pv.spec.capacity, "access_modes": pv.spec.access_modes} for pv in pvs.items] return result
- tools/pv.py:8-8 (registration)The @mcp.tool() decorator registers the pv_list function as an MCP tool.@mcp.tool()