Skip to main content
Glama

service_get

Retrieve detailed information about a specific Kubernetes Service, including configuration and status, to monitor and manage cluster networking resources.

Instructions

Get details of a specific Service.

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

Returns: Detailed information about the Service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • The main handler function for the 'service_get' tool, decorated with @mcp.tool() for registration and @use_current_context. It retrieves detailed information about a specific Kubernetes Service using the Kubernetes API.
    @mcp.tool() @use_current_context def service_get(context_name: str, namespace: str, name: str): """ Get details of a specific Service. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Service name Returns: Detailed information about the Service """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] service = core_v1.read_namespaced_service(name=name, namespace=namespace) return { "name": service.metadata.name, "type": service.spec.type, "cluster_ip": service.spec.cluster_ip, "ports": [{"port": port.port, "target_port": port.target_port} for port in service.spec.ports], "selector": service.spec.selector }
  • server/server.py:22-22 (registration)
    Import of the service tools module in the load_modules function, which triggers the execution of decorators and registers the 'service_get' tool.
    import tools.service # noqa: F401

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