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

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