Skip to main content
Glama

statefulset_list

List all StatefulSets in a specified Kubernetes namespace to manage and monitor stateful applications across clusters using the k8s-pilot server.

Instructions

List all StatefulSets in a given namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace

Returns: List of StatefulSet basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes

Implementation Reference

  • The handler function for the 'statefulset_list' tool. It lists StatefulSets in the specified namespace using the Kubernetes AppsV1Api, returning a list of names and replicas.
    def statefulset_list(context_name: str, namespace: str):
        """
        List all StatefulSets in a given namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
    
        Returns:
            List of StatefulSet basic information
        """
        apps_v1: AppsV1Api = get_api_clients(context_name)["apps"]
        statefulsets = apps_v1.list_namespaced_stateful_set(namespace)
        result = [{"name": ss.metadata.name, "replicas": ss.status.replicas} for ss in statefulsets.items]
        return result
  • The @mcp.tool() decorator registers the statefulset_list function as an MCP tool.
    @mcp.tool()
    @use_current_context
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 it's a list operation, implying read-only behavior, but doesn't disclose key traits like pagination, rate limits, authentication needs, or error handling. For a Kubernetes tool with potential complexity, this is a significant gap.

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 with a clear purpose statement followed by separate 'Args' and 'Returns' sections. It uses minimal words without redundancy, making it easy to parse and front-loaded with essential information.

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?

For a list tool with no annotations and no output schema, the description covers the basic purpose and parameters but lacks details on behavioral aspects (e.g., output format, limitations). It's minimally viable but leaves gaps in understanding how the tool behaves in practice.

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%, but the description includes an 'Args' section that documents both parameters ('context_name' and 'namespace') with clear meanings, effectively compensating for the lack of schema descriptions. Since there are only 2 parameters, this provides adequate coverage.

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 ('List all') and resource ('StatefulSets') with scope ('in a given namespace'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'statefulset_get' or 'pod_list', which would require mentioning it returns multiple items versus single retrieval.

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. With many sibling tools (e.g., 'statefulset_get' for single items, 'pod_list' for different resources), there's no indication of context, prerequisites, or exclusions, leaving the agent to infer usage.

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