statefulset_get
Retrieve detailed information about a specific StatefulSet in Kubernetes, including its configuration and status, to monitor and manage stateful applications.
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 | ||
| namespace | Yes | ||
| name | Yes |
Implementation Reference
- tools/statefulset.py:62-83 (handler)The statefulset_get tool implementation: decorated with @mcp.tool() for registration and executes the Kubernetes API call to retrieve StatefulSet details in the given namespace.@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] }
- tools/statefulset.py:62-62 (registration)Registers the statefulset_get function as an MCP tool.@mcp.tool()