Skip to main content
Glama

pv_update

Update PersistentVolume metadata (e.g., labels) in Kubernetes clusters via the k8s-pilot MCP server. Specify context, PersistentVolume name, and new labels to manage resource configurations efficiently.

Instructions

Update an existing PersistentVolume's metadata (e.g., labels).

Args: context_name: The Kubernetes context name name: The PersistentVolume name labels: New labels to apply to the PersistentVolume

Returns: Status of the update operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
labelsYes
nameYes

Implementation Reference

  • The pv_update tool handler: reads the existing PersistentVolume, updates its labels via patch, and returns the updated status and labels.
    @mcp.tool() @use_current_context @check_readonly_permission def pv_update(context_name: str, name: str, labels: dict): """ Update an existing PersistentVolume's metadata (e.g., labels). Args: context_name: The Kubernetes context name name: The PersistentVolume name labels: New labels to apply to the PersistentVolume Returns: Status of the update operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] pv = core_v1.read_persistent_volume(name=name) pv.metadata.labels = labels updated_pv = core_v1.patch_persistent_volume(name=name, body={"metadata": {"labels": labels}}) return {"name": updated_pv.metadata.name, "status": "Updated", "labels": updated_pv.metadata.labels}
  • tools/pv.py:82-82 (registration)
    Registers the pv_update tool using the @mcp.tool() decorator.
    @mcp.tool()

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