Skip to main content
Glama

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
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • 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
        }

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/bourbonkk/k8s-pilot'

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