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
        """
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states it's a list operation, implying read-only behavior, but doesn't disclose critical details like authentication requirements, rate limits, pagination, error conditions, or what 'basic information' includes. For a Kubernetes tool with no annotations, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. The Args and Returns sections add structure without unnecessary verbosity. However, the 'Returns' section is vague ('List of Secret basic information'), slightly reducing efficiency.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of Kubernetes operations, no annotations, no output schema, and 0% schema coverage, the description is incomplete. It lacks details on authentication, error handling, output format, and differentiation from siblings. For a tool with two required parameters and no structured support, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It lists both parameters ('context_name' and 'namespace') in the Args section, adding basic meaning beyond the schema. However, it doesn't explain what these parameters represent (e.g., Kubernetes context vs. namespace) or provide format examples, leaving gaps in understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'List all Secrets in a given namespace.' It specifies the verb ('List'), resource ('Secrets'), and scope ('in a given namespace'). However, it doesn't explicitly differentiate from sibling tools like 'secret_get' or 'secret_delete', which would require a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With sibling tools like 'secret_get' (for individual secrets) and 'secret_list' (for all secrets), there's no indication of when to choose one over the other. It lacks any context about prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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