Fetch Pod Container Logs
get_pod_logsFetch recent stdout/stderr logs from a Kubernetes pod or specific container to inspect startup errors, stack traces, and sidecar output.
Instructions
Fetch the most recent stdout/stderr log lines from a pod or one specific container inside it.
Returns cluster_id, namespace, pod_name, container, tail_lines, and raw logs text. Omit container for single-container pods (or default container) and adjust tail_lines between 10 and 5000 (default 200).
Use when reading application stack traces, startup logs, or sidecar container output. Prefer get_pod_details when you also need probe definitions, OOM/exit codes, and 12-Step lifecycle status, or get_events for Kubernetes scheduling and kubelet events.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cluster_id": "<cluster_id>",
"namespace": "<namespace>",
"pod_name": "<pod_name>"
},
"name": "get_pod_logs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pod_name | Yes | Exact Kubernetes pod name inside `namespace` (1-253 chars, e.g. 'api-7c9f8b-x9k2p'). Obtain pod names from `get_namespace_resources` or `get_workloads_catalog`. | |
| container | No | Optional container name (1-63 chars) inside a multi-container or sidecar pod. Omit or pass null to fetch logs from the pod's default/primary container. | |
| namespace | Yes | Target Kubernetes namespace name (1-63 chars, e.g. 'default', 'prod'). Use `get_namespaces` to discover available namespaces on the cluster. | |
| cluster_id | Yes | Unique KubeOrbit cluster identifier returned by `list_teams_and_clusters` (1-63 URL-safe chars, e.g. 'gke-prod-us', 'eks-staging'). | |
| tail_lines | No | Number of trailing log lines to return from the end of the container log stream (10-5000, default 200). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| logs | No | Raw newline-delimited container stdout/stderr log output. | |
| pod_name | No | Pod name. | |
| container | No | Container queried, or null when using the default container. | |
| namespace | No | Pod namespace. | |
| cluster_id | No | Cluster identifier queried. | |
| tail_lines | No | Maximum trailing line count requested. |