Skip to main content
Glama

secret_get

Retrieve detailed information about a specific Kubernetes Secret, including its data and metadata, from a specified namespace and cluster context.

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
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • Handler function for the 'secret_get' tool. Retrieves a Kubernetes Secret by name from the specified namespace and context, 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
        }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bourbonkk/k8s-pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server