pv_get
Retrieve detailed information about a specific PersistentVolume in Kubernetes. Specify the context name and PersistentVolume name to access its configuration and status efficiently.
Instructions
Get details of a specific PersistentVolume.
Args: context_name: The Kubernetes context name name: The PersistentVolume name
Returns: Detailed information about the PersistentVolume
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes |
Implementation Reference
- tools/pv.py:58-79 (handler)The pv_get tool handler: retrieves PersistentVolume details using Kubernetes CoreV1Api. Registered via @mcp.tool() decorator. Input schema inferred from function signature (context_name: str, name: str).@mcp.tool() @use_current_context def pv_get(context_name: str, name: str): """ Get details of a specific PersistentVolume. Args: context_name: The Kubernetes context name name: The PersistentVolume name Returns: Detailed information about the PersistentVolume """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] pv = core_v1.read_persistent_volume(name=name) return { "name": pv.metadata.name, "capacity": pv.spec.capacity, "access_modes": pv.spec.access_modes, "storage_class": pv.spec.storage_class_name, "host_path": pv.spec.host_path.path if pv.spec.host_path else None }