Skip to main content
Glama

statefulset_create

Create a StatefulSet in Kubernetes to deploy and manage stateful applications with persistent storage and stable network identities.

Instructions

Create a StatefulSet in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The StatefulSet name image: The container image to use replicas: Number of replicas labels: Labels to apply to the StatefulSet

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
imageYes
replicasYes
labelsYes

Implementation Reference

  • The statefulset_create tool handler function, registered via @mcp.tool() decorator. It creates a Kubernetes StatefulSet in the specified namespace using the provided parameters, leveraging Kubernetes Python client APIs.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def statefulset_create(context_name: str, namespace: str, name: str, image: str, replicas: int, labels: dict):
        """
        Create a StatefulSet in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The StatefulSet name
            image: The container image to use
            replicas: Number of replicas
            labels: Labels to apply to the StatefulSet
    
        Returns:
            Status of the creation operation
        """
        apps_v1: AppsV1Api = get_api_clients(context_name)["apps"]
        statefulset = V1StatefulSet(
            metadata=V1ObjectMeta(name=name, labels=labels),
            spec=V1StatefulSetSpec(
                replicas=replicas,
                selector=V1LabelSelector(match_labels=labels),
                service_name=name,
                template=V1PodTemplateSpec(
                    metadata=V1ObjectMeta(labels=labels),
                    spec=V1PodSpec(containers=[V1Container(name=name, image=image)])
                )
            )
        )
        created_statefulset = apps_v1.create_namespaced_stateful_set(namespace=namespace, body=statefulset)
        return {"name": created_statefulset.metadata.name, "status": "Created"}
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that it 'Create[s] a StatefulSet' and returns 'Status of the creation operation', but lacks critical details: required permissions, whether it's idempotent, error handling, or what the status includes. For a mutation tool with zero annotation coverage, this is insufficient.

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 a clear purpose statement followed by Args and Returns sections. It's appropriately sized without unnecessary fluff, though the parameter explanations could be more informative to earn a higher score.

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

Completeness2/5

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

Given the complexity (6 required parameters, nested object, no output schema, and no annotations), the description is incomplete. It lacks details on behavioral traits, error cases, output format, and differentiation from siblings, making it inadequate for safe and effective use by an AI agent.

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 lists all 6 parameters with brief explanations (e.g., 'The container image to use'), adding basic meaning beyond the schema's titles. However, it doesn't provide format details, constraints, or examples, leaving gaps in understanding.

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 verb ('Create') and resource ('a StatefulSet in the specified namespace'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'deployment_create' or 'daemonset_create' beyond mentioning StatefulSet specifically, which is implied but not contrasted.

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 like 'deployment_create' or 'statefulset_update', nor any prerequisites or context for usage. The description only states what it does without indicating appropriate scenarios or constraints.

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