Skip to main content
Glama

serviceaccount_delete

Remove a Kubernetes ServiceAccount from a specified namespace to manage access control and clean up unused identities in your cluster.

Instructions

Delete a ServiceAccount from the specified namespace.

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

Returns: Status of the deletion operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • The main handler function for the 'serviceaccount_delete' tool. It is decorated with @mcp.tool() which registers it as an MCP tool. The function deletes the specified ServiceAccount in the given namespace using Kubernetes CoreV1Api.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def serviceaccount_delete(context_name: str, namespace: str, name: str):
        """
        Delete a ServiceAccount from the specified namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The ServiceAccount name
    
        Returns:
            Status of the deletion operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        core_v1.delete_namespaced_service_account(name=name, namespace=namespace)
        return {"name": name, "status": "Deleted"}
  • The @mcp.tool() decorator registers the serviceaccount_delete function as an MCP tool.
    @mcp.tool()
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 'Delete a ServiceAccount' which implies a destructive mutation, but doesn't disclose critical behavioral traits: whether deletion is permanent/reversible, required permissions, side effects (e.g., breaking pods using the ServiceAccount), or error handling. The vague 'Status of the deletion operation' return statement adds little value. For a destructive tool with zero annotation coverage, 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 concise with a clear purpose statement followed by parameter and return sections. Every sentence adds value: the first states the action, and the Args/Returns sections provide necessary structure. It could be slightly more front-loaded by integrating parameter context into the main sentence, but there's minimal waste.

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 this is a destructive mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is incomplete. It lacks crucial context: behavioral details (permanence, side effects), error cases, return value specifics, and usage guidance relative to siblings. The agent cannot safely invoke this tool without guessing at important operational aspects.

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

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter documentation. The description lists all three parameters with brief explanations (e.g., 'The Kubernetes context name'), adding basic semantics beyond the schema's titles. However, it doesn't explain format expectations, valid values, or relationships between parameters (e.g., namespace must exist). This partially compensates but leaves gaps.

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 ('Delete') and resource ('ServiceAccount from the specified namespace'), making the purpose immediately understandable. It distinguishes from siblings like serviceaccount_create, serviceaccount_get, and serviceaccount_list by specifying the delete operation. However, it doesn't explicitly contrast with other deletion tools (e.g., clusterrole_delete, configmap_delete), so it's not a perfect 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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a ServiceAccount to exist), consequences (e.g., impact on dependent resources), or when to choose other deletion tools for different resource types. The agent must infer usage from the tool name 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