Skip to main content
Glama

statefulset_list

Retrieve a list of StatefulSets within a specified Kubernetes namespace using context_name for cluster identification, enabling efficient resource monitoring and management across clusters.

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 main handler function for the 'statefulset_list' tool. It lists StatefulSets in a namespace using Kubernetes API, decorated with @mcp.tool() for registration.
    @mcp.tool() @use_current_context 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

Other Tools

Related 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