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()

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