statefulset_get
Retrieve detailed information about a specific StatefulSet in a Kubernetes cluster by providing context name, namespace, and StatefulSet name. Works with the k8s-pilot MCP server for cluster management.
Instructions
Get details of a specific StatefulSet.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The StatefulSet name
Returns: Detailed information about the StatefulSet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/statefulset.py:62-83 (handler)The core handler function for the 'statefulset_get' tool. Decorated with @mcp.tool() for registration and @use_current_context for context management. Retrieves StatefulSet details using Kubernetes AppsV1Api and returns name, replicas, labels, and container images.@mcp.tool() @use_current_context def statefulset_get(context_name: str, namespace: str, name: str): """ Get details of a specific StatefulSet. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The StatefulSet name Returns: Detailed information about the StatefulSet """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] statefulset = apps_v1.read_namespaced_stateful_set(name=name, namespace=namespace) return { "name": statefulset.metadata.name, "replicas": statefulset.status.replicas, "labels": statefulset.metadata.labels, "containers": [c.image for c in statefulset.spec.template.spec.containers] }