Skip to main content
Glama

configmap_create

Create a ConfigMap in a specified Kubernetes namespace to store configuration data for applications running in your cluster.

Instructions

Create a ConfigMap in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ConfigMap name data: The data to store in the ConfigMap

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
dataYes

Implementation Reference

  • The main handler function implementing the logic to create a Kubernetes ConfigMap using CoreV1Api after permission checks.
    def configmap_create(context_name: str, namespace: str, name: str, data: dict):
        """
        Create a ConfigMap in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The ConfigMap name
            data: The data to store in the ConfigMap
    
        Returns:
            Status of the creation operation
        """
        from kubernetes.client import V1ConfigMap, V1ObjectMeta
    
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        configmap = V1ConfigMap(
            metadata=V1ObjectMeta(name=name),
            data=data
        )
        created_configmap = core_v1.create_namespaced_config_map(namespace=namespace, body=configmap)
        return {"name": created_configmap.metadata.name, "status": "Created"}
  • The @mcp.tool() decorator registers the configmap_create function with the MCP server.
    @mcp.tool()
  • server/server.py:10-10 (registration)
    Import statement in load_modules() that loads the configmap module, triggering the tool registration via decorators.
    import tools.configmap  # noqa: F401
  • Type annotations and docstring define the input schema (parameters) and output format for the tool.
    def configmap_create(context_name: str, namespace: str, name: str, data: dict):
        """
        Create a ConfigMap in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The ConfigMap name
            data: The data to store in the ConfigMap
    
        Returns:
            Status of the creation operation
        """
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a creation operation but doesn't disclose behavioral traits like required permissions, whether it's idempotent, error conditions (e.g., duplicate names), or what 'Status of the creation operation' entails. This leaves significant gaps for a mutation tool.

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

Conciseness5/5

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

The description is efficiently structured with a clear purpose statement followed by Args and Returns sections. Every sentence adds value without redundancy, making it easy to parse.

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

Completeness3/5

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

For a mutation tool with no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and parameters but lacks behavioral context, error handling, and detailed return value explanation, which are important for Kubernetes operations.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates well by listing all 4 parameters with brief explanations (e.g., 'The data to store in the ConfigMap'). However, it doesn't provide format details (e.g., data structure expectations) or examples, preventing a perfect score.

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 verb ('Create') and resource ('a ConfigMap in the specified namespace'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like configmap_update or configmap_get, which would be needed for a perfect score.

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 like configmap_update or configmap_list. It also doesn't mention prerequisites (e.g., needing appropriate permissions or namespace existence) or contextual constraints.

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