replicaset_get
Retrieve detailed information about a specific ReplicaSet in a Kubernetes cluster by providing context name, namespace, and ReplicaSet name. Useful for cluster management and debugging.
Instructions
Get details of a specific ReplicaSet.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ReplicaSet name
Returns: Detailed information about the ReplicaSet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/replicaset.py:61-82 (handler)The complete implementation of the 'replicaset_get' tool, including registration via @mcp.tool(), type hints serving as input schema, and the handler logic that retrieves ReplicaSet details from Kubernetes API.@mcp.tool() @use_current_context def replicaset_get(context_name: str, namespace: str, name: str): """ Get details of a specific ReplicaSet. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ReplicaSet name Returns: Detailed information about the ReplicaSet """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] replicaset = apps_v1.read_namespaced_replica_set(name=name, namespace=namespace) return { "name": replicaset.metadata.name, "replicas": replicaset.status.replicas, "labels": replicaset.metadata.labels, "containers": [c.image for c in replicaset.spec.template.spec.containers] }
- tools/replicaset.py:61-61 (registration)Registration of the replicaset_get tool using the @mcp.tool() decorator from server.server.mcp.@mcp.tool()