Skip to main content
Glama

secret_update

Modify Kubernetes Secrets by updating key-value pairs in a specified namespace. This tool changes sensitive configuration data stored as base64-encoded values for applications.

Instructions

Update an existing 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)

Returns: Status of the update operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
dataYes

Implementation Reference

  • The core handler implementation for the 'secret_update' MCP tool. It reads the existing Kubernetes Secret, encodes the provided data, updates the Secret's data field, and replaces the Secret in the cluster using the Kubernetes API. Decorators handle tool registration (@mcp.tool()), context management (@use_current_context), and permissions (@check_readonly_permission).
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def secret_update(context_name: str, namespace: str, name: str, data: dict):
        """
        Update an existing 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)
    
        Returns:
            Status of the update operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        secret = core_v1.read_namespaced_secret(name=name, namespace=namespace)
        encoded_data = {key: base64.b64encode(value.encode()).decode() for key, value in data.items()}
        secret.data.update(encoded_data)
        updated_secret = core_v1.replace_namespaced_secret(name=name, namespace=namespace, body=secret)
        return {"name": updated_secret.metadata.name, "status": "Updated"}
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It mentions that values will be base64 encoded, which is useful, but doesn't disclose critical traits like required permissions, whether this overwrites or merges data, error conditions, or what 'Status of the update operation' entails. For a mutation tool in Kubernetes with security implications, this is inadequate.

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. The Args and Returns sections are structured clearly, though the Returns statement is vague. Every sentence serves a purpose, with no redundant information.

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 (Kubernetes secret update with 4 params, no annotations, no output schema), the description is incomplete. It lacks details on authentication, error handling, response format, and interaction with sibling tools. The vague return statement ('Status of the update operation') without an output schema leaves the agent guessing about results.

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 successfully explains all 4 parameters: context_name, namespace, name, and data, with specific details for data ('A dictionary of key-value pairs (values will be base64 encoded)'). This adds meaningful semantics beyond the bare schema, though it could elaborate on parameter formats or constraints.

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 action ('Update') and resource ('an existing Secret in the specified namespace'), making the purpose immediately understandable. It distinguishes from sibling tools like secret_create, secret_delete, secret_get, and secret_list by specifying it's for updating existing secrets rather than creating, deleting, retrieving, or listing them.

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. It doesn't mention prerequisites (like needing an existing secret), compare with secret_create for new secrets, or indicate when secret_get might be needed first. The agent must infer usage from the tool name and sibling list alone.

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