Skip to main content
Glama

pv_create

Create PersistentVolumes in Kubernetes clusters to provide storage resources for applications, specifying capacity, access modes, and storage class.

Instructions

Create a PersistentVolume in the cluster.

Args: context_name: The Kubernetes context name name: The PersistentVolume name capacity: The storage capacity (e.g., "10Gi") access_modes: List of access modes (e.g., ["ReadWriteOnce"]) storage_class: The storage class name host_path: The host path for the volume

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
nameYes
capacityYes
access_modesYes
storage_classYes
host_pathYes

Implementation Reference

  • The handler function for the 'pv_create' tool. It creates a Kubernetes PersistentVolume with the specified parameters using the CoreV1Api.
    def pv_create(context_name: str, name: str, capacity: str, access_modes: list, storage_class: str, host_path: str):
        """
        Create a PersistentVolume in the cluster.
    
        Args:
            context_name: The Kubernetes context name
            name: The PersistentVolume name
            capacity: The storage capacity (e.g., "10Gi")
            access_modes: List of access modes (e.g., ["ReadWriteOnce"])
            storage_class: The storage class name
            host_path: The host path for the volume
    
        Returns:
            Status of the creation operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        pv = V1PersistentVolume(
            metadata=V1ObjectMeta(name=name),
            spec=V1PersistentVolumeSpec(
                capacity={"storage": capacity},
                access_modes=access_modes,
                storage_class_name=storage_class,
                host_path={"path": host_path}
            )
        )
        created_pv = core_v1.create_persistent_volume(body=pv)
        return {"name": created_pv.metadata.name, "status": "Created"}
  • tools/pv.py:26-28 (registration)
    Decorators registering and configuring the 'pv_create' tool with MCP, context usage, and read-only permission check.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it states this is a creation operation, it doesn't mention permission requirements, whether this is a mutating operation, potential side effects, error conditions, or what 'Status of the creation operation' actually means. For a Kubernetes resource creation tool, this is a significant gap in behavioral context.

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 well-structured with clear sections (Args, Returns) and uses bullet-like formatting. Each sentence earns its place, though the 'Returns' section could be more specific. The front-loaded purpose statement is effective, making this appropriately sized for a 6-parameter tool.

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 of Kubernetes PersistentVolume creation, no annotations, and no output schema, the description provides basic but incomplete coverage. It documents parameters well but lacks crucial context about permissions, error handling, and what the return status actually contains. For a mutating operation in a complex system, this is minimally adequate but has clear gaps.

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?

With 0% schema description coverage, the description compensates well by listing all 6 parameters with brief explanations and examples. It clarifies what each parameter represents (e.g., 'capacity: The storage capacity (e.g., "10Gi")'), which adds meaningful context beyond the bare schema. The examples for 'capacity' and 'access_modes' are particularly helpful.

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 ('Create a PersistentVolume') and resource ('in the cluster'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'pv_update' or 'pvc_create' beyond the creation aspect, which prevents a perfect score.

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 like 'pvc_create' (PersistentVolumeClaim) or other volume-related operations. There's no mention of prerequisites, typical use cases, or when not to use this tool, leaving the agent with insufficient contextual guidance.

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