secret_list
Retrieve and list all Kubernetes Secrets in a specified namespace using the k8s-pilot server. Simplify cluster resource management with centralized access to Secret details.
Instructions
List all Secrets in a given namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace
Returns: List of Secret basic information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/secret.py:9-25 (handler)The main handler function for the 'secret_list' tool. It is decorated with @mcp.tool() for registration and @use_current_context. Lists Kubernetes secrets in the specified namespace and context, returning their names and types.@mcp.tool() @use_current_context def secret_list(context_name: str, namespace: str): """ List all Secrets in a given namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace Returns: List of Secret basic information """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] secrets = core_v1.list_namespaced_secret(namespace) result = [{"name": secret.metadata.name, "type": secret.type} for secret in secrets.items] return result