secret_get
Retrieve detailed information about a specific Kubernetes Secret within a given namespace and context using the k8s-pilot server. Simplify cluster resource management and access critical Secret data efficiently.
Instructions
Get details of a specific Secret.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Secret name
Returns: Detailed information about the Secret
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/secret.py:56-77 (handler)The handler function for the 'secret_get' MCP tool. It retrieves a specific Kubernetes Secret from the given namespace, decodes its base64-encoded data, and returns the secret's name, type, and decoded data.@mcp.tool() @use_current_context def secret_get(context_name: str, namespace: str, name: str): """ Get details of a specific Secret. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Secret name Returns: Detailed information about the Secret """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] secret = core_v1.read_namespaced_secret(name=name, namespace=namespace) decoded_data = {key: base64.b64decode(value).decode() for key, value in secret.data.items()} return { "name": secret.metadata.name, "type": secret.type, "data": decoded_data }
- tools/secret.py:56-56 (registration)The @mcp.tool() decorator registers the secret_get function as an MCP tool.@mcp.tool()
- tools/secret.py:59-69 (schema)The docstring provides the input schema (parameters) and output description for the secret_get tool.""" Get details of a specific Secret. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Secret name Returns: Detailed information about the Secret """