get_service_summaries
List Kubernetes services with summaries including name, type, cluster IP, ports, and labels for a specific namespace or all namespaces.
Instructions
Retrieves a list of ServiceSummary objects for services in a given namespace or all namespaces.
Similar to kubectl get services.
Parameters
----------
namespace : Optional[str], default=None
The specific namespace to list services from. If None, lists services from all namespaces.
Returns
-------
list of ServiceSummary
A list of ServiceSummary objects, each providing a summary of a service's status with the following fields:
name : str
Name of the service.
namespace : str
Namespace in which the service is running.
type : str
Type of the service (ClusterIP, NodePort, LoadBalancer, ExternalName).
cluster_ip : Optional[str]
Cluster IP address assigned to the service (None for ExternalName services).
external_ip : Optional[str]
External IP address if applicable (for LoadBalancer services).
ports : list[PortInfo]
List of ports (and their protocols) exposed by the service.
age : datetime.timedelta
Age of the service (current time minus creation timestamp).
selector : dict[str, str]
The label selector the service uses to choose backing pods. Empty
for services without a selector (e.g. ExternalName, or manually
managed Endpoints).
labels : dict[str, str]
Labels on the service object.
annotations : dict[str, str]
Annotations on the service object.
Raises
------
K8sConfigError
If unable to initialize the K8S API.
K8sApiError
If the API call to list services fails.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_service_summaries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |