Skip to main content
Glama

configmap_list

List all ConfigMaps in a specified Kubernetes namespace to view configuration data and manage application settings across clusters.

Instructions

List all ConfigMaps in a given namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace

Returns: List of ConfigMap basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the logic to list ConfigMaps in a specified namespace using the Kubernetes CoreV1Api.
    @mcp.tool()
    @use_current_context
    def configmap_list(context_name: str, namespace: str):
        """
        List all ConfigMaps in a given namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
    
        Returns:
            List of ConfigMap basic information
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        configmaps = core_v1.list_namespaced_config_map(namespace)
        result = [{"name": cm.metadata.name} for cm in configmaps.items]
        return result

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