Skip to main content
Glama

service_list

Retrieve a list of all Kubernetes Services in a specified namespace to monitor network endpoints and manage cluster connectivity.

Instructions

List all Services in a given namespace.

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

Returns: List of Service basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes

Implementation Reference

  • The handler function that lists Kubernetes Services in the specified namespace using CoreV1Api. Returns a list of service names, types, and cluster IPs.
    def service_list(context_name: str, namespace: str):
        """
        List all Services in a given namespace.
    
        Args:
            context_name: The Kubernetes context name
            namespace: The Kubernetes namespace
    
        Returns:
            List of Service basic information
        """
        core_v1: CoreV1Api = get_api_clients(context_name)["core"]
        services = core_v1.list_namespaced_service(namespace)
        result = [{"name": svc.metadata.name, "type": svc.spec.type, "cluster_ip": svc.spec.cluster_ip} for svc in services.items]
        return result
  • tools/service.py:8-8 (registration)
    Registers the service_list tool using the @mcp.tool() decorator.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'List all Services' implies a read-only operation, it doesn't explicitly state this is a safe read operation. It doesn't mention authentication requirements, rate limits, error conditions, or what happens with empty namespaces. The description provides minimal behavioral context beyond the basic operation.

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 efficiently structured with a clear purpose statement followed by Args and Returns sections. Each sentence serves a purpose, though the parameter descriptions could be more informative. The structure is logical and easy to parse, with no wasted words or 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?

For a Kubernetes listing tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'Service basic information' includes, how results are formatted, whether there's pagination, error handling, or authentication requirements. The minimal parameter explanations and lack of behavioral context leave significant gaps for proper tool usage.

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 includes an Args section that names the two parameters (context_name, namespace) but provides no semantic explanation of what these mean, valid values, or format requirements. It adds basic parameter identification but minimal semantic value beyond what's evident from parameter names.

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 'List all Services in a given namespace' which specifies the verb (list), resource (Services), and scope (namespace). It distinguishes from other service_* tools by focusing on listing rather than creating, deleting, getting, or updating services. However, it doesn't explicitly differentiate from other list operations like pod_list or configmap_list 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 when to use service_list versus service_get (for a single service) or other list tools for different resources. There's no discussion of prerequisites, context selection, or namespace requirements beyond what's in the parameters.

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