Skip to main content
Glama

pv_list

Retrieve and list all PersistentVolumes in a Kubernetes cluster by specifying the context name, enabling efficient management of storage resources across multiple clusters.

Instructions

List all PersistentVolumes in the cluster.

Args: context_name: The Kubernetes context name

Returns: List of PersistentVolume basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes

Implementation Reference

  • The handler function pv_list that implements the tool logic: lists PersistentVolumes in the Kubernetes cluster using CoreV1Api, decorated with @mcp.tool() for registration and @use_current_context.
    @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
  • server/server.py:17-17 (registration)
    Import of the tools.pv module within load_modules() function, which triggers the @mcp.tool() decorator to register the pv_list tool with the MCP server.
    import tools.pv # noqa: F401

Other Tools

Related Tools

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