Skip to main content
Glama

secret_create

Create Kubernetes Secrets to store sensitive data like passwords and API keys in a specified namespace, with automatic base64 encoding of values.

Instructions

Create a Secret in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Secret name data: A dictionary of key-value pairs (values will be base64 encoded) secret_type: The type of the Secret (default is "Opaque")

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
dataYes
secret_typeNoOpaque

Implementation Reference

  • The main handler function for the 'secret_create' tool. It is decorated with @mcp.tool() which likely registers it as an MCP tool. The function creates a Kubernetes Secret in the specified namespace by encoding the provided data as base64 and using the Kubernetes CoreV1Api.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def secret_create(context_name: str, namespace: str, name: str, data: dict, secret_type: str = "Opaque"):
        """
        Create a Secret in the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The Secret name
            data: A dictionary of key-value pairs (values will be base64 encoded)
            secret_type: The type of the Secret (default is "Opaque")
    
        Returns:
            Status of the creation operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        encoded_data = {key: base64.b64encode(value.encode()).decode() for key, value in data.items()}
        secret = V1Secret(
            metadata=V1ObjectMeta(name=name),
            data=encoded_data,
            type=secret_type
        )
        created_secret = core_v1.create_namespaced_secret(namespace=namespace, body=secret)
        return {"name": created_secret.metadata.name, "status": "Created"}
  • tools/secret.py:28-28 (registration)
    The @mcp.tool() decorator registers the secret_create function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that values in the data dictionary 'will be base64 encoded', which adds useful context beyond the schema. However, it lacks critical information such as required permissions, whether the operation is idempotent, error handling, or what 'Status of the creation operation' entails, leaving 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.

Conciseness4/5

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

The description is well-structured with a brief purpose statement followed by Args and Returns sections, making it easy to parse. It's appropriately sized with no wasted sentences, though the 'Returns' line is vague and could be more informative.

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?

Given the complexity of a Kubernetes secret creation tool with 5 parameters, no annotations, and no output schema, the description is moderately complete. It covers parameter semantics well but lacks behavioral details like permissions or error handling, and the return value description is insufficient without an output schema.

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?

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all 5 parameters, explaining their roles (e.g., 'context_name: The Kubernetes context name', 'data: A dictionary of key-value pairs (values will be base64 encoded)'), and notes the default for secret_type. This adds substantial value beyond the bare schema.

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 'Secret in the specified namespace', making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like secret_update 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?

No guidance is provided on when to use this tool versus alternatives like secret_update or secret_delete, nor are any prerequisites or context for Kubernetes operations mentioned. The description only states what the tool does, not when to use it.

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