Skip to main content
Glama

service_list

List all Services in a specified Kubernetes namespace using context_name and namespace inputs. Retrieve Service basic information for efficient cluster management.

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 service_list tool handler function. Lists Kubernetes Services in the given namespace using CoreV1Api, decorated with @mcp.tool() for registration and @use_current_context for context management.
    @mcp.tool() @use_current_context 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
  • server/server.py:22-22 (registration)
    Import of tools.service module in load_modules() function, which triggers registration of all service-related tools including service_list via their @mcp.tool() decorators.
    import tools.service # noqa: F401

Other Tools

Related 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