Skip to main content
Glama

secret_list

List all Kubernetes Secrets in a specified namespace to manage sensitive configuration data across clusters.

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

Implementation Reference

  • The handler function for the 'secret_list' MCP tool. It lists all Kubernetes Secrets in the specified namespace using the CoreV1Api, returning a list of secret names and types.
    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
  • tools/secret.py:9-10 (registration)
    The @mcp.tool() decorator registers the secret_list function as an MCP tool, with @use_current_context decorator for context management.
    @mcp.tool() @use_current_context
  • Type hints and docstring define the input schema (context_name: str, namespace: str) and output (list of dicts with name and type).
    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 """

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