pod_list
Retrieve a list of Kubernetes pods within a specified namespace using the tool. Efficiently manage and monitor pod details by providing the context name and namespace.
Instructions
List all pods in a given namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace
Returns: List of pod basic information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/pod.py:10-26 (handler)The pod_list tool handler: lists pods in the specified namespace using the Kubernetes CoreV1Api. Registered via @mcp.tool() decorator, which likely handles schema and registration.@mcp.tool() @use_current_context def pod_list(context_name: str, namespace: str): """ List all pods in a given namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace Returns: List of pod basic information """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] pods = core_v1.list_namespaced_pod(namespace) result = [{"name": pod.metadata.name} for pod in pods.items] return result