configmap_get
Retrieve detailed information about a specific Kubernetes ConfigMap by specifying the context, namespace, and name. Facilitates efficient resource management in multi-cluster environments.
Instructions
Get details of a specific ConfigMap.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ConfigMap name
Returns: Detailed information about the ConfigMap
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/configmap.py:54-54 (registration)Registers the configmap_get tool using the MCP decorator.@mcp.tool()
- tools/configmap.py:56-70 (handler)The main handler function that retrieves and returns the details of a specific ConfigMap using the Kubernetes API.def configmap_get(context_name: str, namespace: str, name: str): """ Get details of a specific ConfigMap. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ConfigMap name Returns: Detailed information about the ConfigMap """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] configmap = core_v1.read_namespaced_config_map(name=name, namespace=namespace) return {"name": configmap.metadata.name, "data": configmap.data}