Skip to main content
Glama

service_get

Retrieve detailed information about a specific Kubernetes Service by providing the context name, namespace, and Service name using the k8s-pilot MCP server.

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
nameYes
namespaceYes

Implementation Reference

  • The handler function decorated with @mcp.tool() implements the 'service_get' tool. It fetches a specific Kubernetes Service from the given namespace using the CoreV1Api and returns its details including name, type, cluster IP, ports, and selector.
    @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 }
  • tools/service.py:58-58 (registration)
    The @mcp.tool() decorator registers the service_get function as an MCP tool.
    @mcp.tool()

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