Skip to main content
Glama

pv_update

Update PersistentVolume metadata like labels in Kubernetes clusters to manage storage resources and organize volumes effectively.

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
nameYes
labelsYes

Implementation Reference

  • The main handler function for the 'pv_update' tool. It reads the PersistentVolume, updates its labels via patch, and returns the status. Registered via @mcp.tool() decorator.
    @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}
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 overwrites or merges labels, requires specific permissions, has side effects on resources, or provides error handling. The mention of 'Status of the update operation' hints at a response but lacks detail on format or potential outcomes.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The Args and Returns sections add structure without redundancy. However, the example in parentheses ('e.g., labels') could be more integrated, and some sentences like 'Returns: Status of the update operation' are vague, slightly reducing efficiency.

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 3 parameters with 0% schema coverage, no annotations, and no output schema, the description is moderately complete. It covers the basic purpose and parameters but lacks behavioral context, usage guidelines, and detailed output information. For a mutation tool in a complex Kubernetes environment, this leaves significant gaps in understanding how to use it effectively.

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

Parameters3/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 adds meaning by explaining each parameter's purpose: 'context_name' as Kubernetes context, 'name' as PersistentVolume name, and 'labels' as new labels to apply. This clarifies semantics beyond schema types, but doesn't provide format details (e.g., label structure) or constraints, leaving gaps for the 3 parameters.

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 ('PersistentVolume's metadata') with a specific example ('e.g., labels'). It distinguishes from siblings like pv_create, pv_delete, pv_get, and pv_list by focusing on metadata updates rather than creation, deletion, retrieval, or listing. However, it doesn't explicitly differentiate from pvc_update or other update tools beyond the resource type.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., existing PersistentVolume), exclusions (e.g., cannot update other fields beyond metadata), or when to choose siblings like pvc_update for PersistentVolumeClaims instead. Usage is implied by the name and parameters but not explicitly stated.

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