Skip to main content
Glama

service_update

Modify Kubernetes Service metadata like labels to reflect changes in cluster organization or routing requirements.

Instructions

Update an existing Service's metadata (e.g., labels).

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Service name labels: New labels to apply to the Service

Returns: Status of the update operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes
labelsYes

Implementation Reference

  • Handler function for the MCP tool 'service_update', which patches labels on an existing Kubernetes Service. Registered using the @mcp.tool() decorator.
    @mcp.tool()
    @use_current_context
    @check_readonly_permission
    def service_update(context_name: str, namespace: str, name: str, labels: dict):
        """
        Update an existing Service's metadata (e.g., labels).
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
            name: The Service name
            labels: New labels to apply to the Service
    
        Returns:
            Status of the update operation
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        service = core_v1.read_namespaced_service(name=name, namespace=namespace)
        service.metadata.labels = labels
        updated_service = core_v1.patch_namespaced_service(name=name, namespace=namespace, body={"metadata": {"labels": labels}})
        return {"name": updated_service.metadata.name, "status": "Updated", "labels": updated_service.metadata.labels}
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is an update operation, implying mutation, but lacks critical details: required permissions (e.g., cluster admin vs. namespace-level access), whether changes are reversible, side effects (e.g., pod restarts), rate limits, or what the 'Status of the update operation' entails (success/failure indicators). For a mutation tool with zero annotation coverage, this is a significant gap.

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 well-structured: a clear purpose statement followed by Args and Returns sections. Every sentence adds value, with no redundant or vague phrasing. It could be slightly more concise by integrating the Args list into the main sentence, but the separation aids readability.

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 (mutation tool in Kubernetes with 4 parameters, nested objects in 'labels'), no annotations, and no output schema, the description is incomplete. It lacks error handling details, authentication requirements, impact on running services, and specifics of the return status. For a tool that modifies cluster state, this leaves the agent under-informed about risks and outcomes.

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 descriptions. The description adds basic semantics for all four parameters in the Args section, explaining what each represents (e.g., 'The Kubernetes context name'). However, it doesn't provide format details (e.g., label structure, namespace naming conventions), validation rules, or examples, leaving gaps in practical usage guidance.

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 ('Update') and resource ('an existing Service's metadata'), with a specific example ('labels'). It distinguishes from siblings like service_create, service_delete, and service_get by focusing on metadata updates rather than creation, deletion, or retrieval. However, it doesn't explicitly differentiate from other update tools (e.g., configmap_update, deployment_update) beyond the resource type.

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., existing service), when-not-to-use scenarios (e.g., for creating new services), or direct alternatives among siblings (e.g., service_create for new services, service_get for viewing metadata). The agent must infer usage from the tool name and context 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