pvc_get
Retrieve detailed information about a specific PersistentVolumeClaim in a Kubernetes cluster. Specify the context name, namespace, and PVC name to access its configuration and status.
Instructions
Get details of a specific PersistentVolumeClaim.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The PersistentVolumeClaim name
Returns: Detailed information about the PersistentVolumeClaim
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/pvc.py:58-80 (handler)The handler function for the 'pvc_get' MCP tool. It is decorated with @mcp.tool() for automatic registration and @use_current_context for context management. The function retrieves detailed information about a specific PersistentVolumeClaim (PVC) in the given namespace using the Kubernetes API.@mcp.tool() @use_current_context def pvc_get(context_name: str, namespace: str, name: str): """ Get details of a specific PersistentVolumeClaim. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The PersistentVolumeClaim name Returns: Detailed information about the PersistentVolumeClaim """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] pvc = core_v1.read_namespaced_persistent_volume_claim(name=name, namespace=namespace) return { "name": pvc.metadata.name, "status": pvc.status.phase, "storage": pvc.spec.resources.requests.get("storage"), "access_modes": pvc.spec.access_modes, "storage_class": pvc.spec.storage_class_name }