Skip to main content
Glama
abhijeetka
by abhijeetka

get_statefulsets

Retrieve all StatefulSets in a specified Kubernetes namespace to monitor and manage persistent application deployments.

Instructions

Get all statefulsets in the specified namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNodefault

Implementation Reference

  • The main handler function for the 'get_statefulsets' tool. It runs 'kubectl get statefulsets' in the specified namespace, parses the JSON output, and returns it or an error dictionary.
    async def get_statefulsets(namespace: str = "default") -> dict:
        """Get all statefulsets in the specified namespace"""
        try:
            cmd = ["kubectl", "get", "statefulsets", "-n", namespace, "-o", "json"]
            result = subprocess.run(cmd, capture_output=True, text=True, check=True)
            return json.loads(result.stdout)
        except subprocess.CalledProcessError as e:
            return {"error": f"Failed to get statefulsets: {str(e)}"}
  • kubernetes.py:107-107 (registration)
    The @mcp.tool() decorator registers the get_statefulsets function as an MCP tool with FastMCP.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action ('Get all statefulsets') but lacks behavioral details such as permissions required, output format, pagination, error handling, or rate limits. For a read operation with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse. Every word contributes directly to the tool's purpose.

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 (Kubernetes resource query), lack of annotations, no output schema, and low parameter coverage, the description is incomplete. It doesn't address return values, error cases, or operational context, leaving gaps for an AI agent to understand how to use it effectively.

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

Parameters2/5

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

The schema has 1 parameter with 0% description coverage, and the description adds minimal semantics. It mentions 'specified namespace' but doesn't explain the parameter's role, default value, or format. This doesn't compensate for the low schema coverage, leaving the parameter poorly documented.

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 ('Get') and resource ('all statefulsets'), specifying the scope ('in the specified namespace'). It distinguishes from siblings like get_deployments or get_pods by focusing on statefulsets, though it doesn't explicitly contrast them. The purpose is specific and actionable.

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, such as needing cluster access, or differentiate from similar tools like get_deployments or get_daemonsets. Usage is implied by the name and description alone, with no explicit context or exclusions.

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/abhijeetka/mcp-k8s-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server