pvc_get
Retrieve detailed information about a specific PersistentVolumeClaim in Kubernetes, including its configuration and status, by specifying the context, namespace, and claim name.
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 | ||
| namespace | Yes | ||
| name | Yes |
Implementation Reference
- tools/pvc.py:58-80 (handler)The main handler function for the 'pvc_get' tool. It fetches detailed information about a specific PersistentVolumeClaim (PVC) in a Kubernetes namespace using the CoreV1Api. The function is decorated with @mcp.tool() which registers it as an MCP tool.@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 }