Skip to main content
Glama

pvc_update

Update metadata such as labels on an existing PersistentVolumeClaim in Kubernetes to manage storage resource organization and access control.

Instructions

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

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

Returns: Status of the update operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
labelsYes

Implementation Reference

  • The handler function for the 'pvc_update' MCP tool. It updates the labels on a specified PersistentVolumeClaim (PVC) in a Kubernetes namespace using the Kubernetes CoreV1 API. Decorated with @mcp.tool() for registration.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def pvc_update(context_name: str, namespace: str, name: str, labels: dict):
        """
        Update an existing PersistentVolumeClaim's metadata (e.g., labels).
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The PersistentVolumeClaim name
            labels: New labels to apply to the PersistentVolumeClaim
    
        Returns:
            Status of the update operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        pvc = core_v1.read_namespaced_persistent_volume_claim(name=name, namespace=namespace)
        pvc.metadata.labels = labels
        updated_pvc = core_v1.patch_namespaced_persistent_volume_claim(name=name, namespace=namespace, body={"metadata": {"labels": labels}})
        return {"name": updated_pvc.metadata.name, "status": "Updated", "labels": updated_pvc.metadata.labels}
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states this is an update operation but doesn't disclose behavioral traits like whether it's idempotent, requires specific permissions, what happens on failure, or if it's destructive (e.g., overwrites existing labels). The mention of 'metadata (e.g., labels)' implies non-destructive updates to metadata only, but this isn't explicit. More context on safety and side effects is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and front-loaded with the core purpose in the first sentence. The Args and Returns sections are clearly labeled and concise, with each parameter explained in a single phrase. No wasted words or redundant information—every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (Kubernetes update operation), no annotations, no output schema, and 0% schema coverage, the description is moderately complete. It covers the purpose and parameters well but lacks behavioral context (e.g., error handling, idempotency) and output details beyond 'Status of the update operation'. For a mutation tool with no structured support, it should do more to guide safe usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all 4 parameters: context_name, namespace, name, and labels, explaining what each represents (e.g., 'New labels to apply'). This adds significant value beyond the bare schema, though it doesn't detail label format or constraints. With 0% coverage, this is strong but not perfect compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Update') and resource ('PersistentVolumeClaim's metadata'), with a specific example ('labels'). It distinguishes from siblings like pvc_create, pvc_delete, pvc_get, and pvc_list by focusing on metadata updates rather than creation, deletion, retrieval, or listing. However, it doesn't explicitly differentiate from pv_update (PersistentVolume vs PersistentVolumeClaim).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., the PVC must exist), compare with similar tools like configmap_update or deployment_update, or specify when not to use it (e.g., for non-metadata changes). The description assumes the user knows when this operation is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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